Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REPL: enable visual selection #24725

Merged
merged 3 commits into from
Nov 27, 2017
Merged

REPL: enable visual selection #24725

merged 3 commits into from
Nov 27, 2017

Conversation

rfourquet
Copy link
Member

Like in ipython and emacs, when the mark is set twice in a row,
the region is set to "active", which means visually that
it is highlighted. Once it's active, setting the mark or pressing
Ctrl-G de-activates the region.

@rfourquet rfourquet added the REPL Julia's REPL (Read Eval Print Loop) label Nov 23, 2017
@rfourquet rfourquet force-pushed the rf/repl/active-region branch from 1256ff9 to 6f4aad0 Compare November 24, 2017 18:07
@rfourquet
Copy link
Member Author

I will merge in a couple of days if no objection.

@Liso77
Copy link

Liso77 commented Nov 25, 2017

Sorry for out of scope comment but maybe you could do small fix in one commit:

Home, ^A | Move to beginning of line
(from https://github.com/JuliaLang/julia/blob/master/doc/src/manual/interacting-with-julia.md )
doesn't do same thing on my linux in case of multiline edit. Home jump to first line ^A stay in current line. (same with End and ^E)

@rfourquet
Copy link
Member Author

maybe you could do small fix in one commit:

Thanks for reporting, and actually you are very welcome to contribute this fix! (I won't do it in this PR, as it's unrelated).

@rfourquet rfourquet force-pushed the rf/repl/active-region branch from 6f4aad0 to f2d3b85 Compare November 26, 2017 18:13
@rfourquet
Copy link
Member Author

rfourquet commented Nov 26, 2017

I added basic support for "shift-selection", i.e. pressing shift with an arrow key highlights the region.
EDIT: with tmux, shift-down is apparently translated to shift-up, so this is not very usable.
EDIT2: will be fixed on tmux 2.7

This can be useful for subsequent tasks, in particular for
being able to alter the behavior of `refresh_line` depending
on which command is currently running.
Like in ipython and emacs, when the mark is set twice in a row,
the region is set to "active", which means visually that
it is highlighted. Once it's active, setting the mark or pressing
Ctrl-G de-activates the region.
Navigating with arrow-keys while pressing the shift key
activates the region.
@rfourquet rfourquet force-pushed the rf/repl/active-region branch from f2d3b85 to 25b82ff Compare November 27, 2017 15:29
@rfourquet
Copy link
Member Author

There is one travis failure, which was seen elsewhere so must be not related:

Test Failed at /private/tmp/julia/share/julia/test/repl.jl:167
 Expression: wait(get_stdout) == "HI\n"
  Evaluated: "" == "HI\n"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants