-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
Change key bindings for folding in PGCodeMirror. #2594
Change key bindings for folding in PGCodeMirror. #2594
Conversation
Perhaps use Ctrl-Shift-[ (and Cmd-Shift-[ on MacOS) for code folding, and Ctrl-Shift-] (and Cmd-Shift-] on MacOS) for code unfolding instead. Those are the keybindings that CodeMirror 6 uses for this. We are about to switch to CodeMirror 6 in any case, so this pull request will probably be somewhat short lived. |
By the way, CodeMirror 6 also uses Ctl-Alt-[ and Ctl-Alt-] for folding and unfolding all (of course with Cmd for MacOS instead). |
Good suggestions, I discovered that Shift-Ctrl-W closes my firefox windows, trying to find keybindings that don't mess with other things. |
I just realized that CodeMirror 5 does not have a close for a single fold. It is just a toggle. So use Ctrl-Shift-[ for toggling a single fold, Ctrl-Alt-[ for folding all, and Ctrl-Alt-] for unfolding all. |
@drgrice, how do you insert a |
be48b2d
to
605e63b
Compare
Ahh figured it out in the docs, |
Bindings updated to @drgrice1 suggestions. Even though these will be replaced soon, I'm going to apply them to my 2.19 install, I could make this a hotfix if others wanted the find/replace functionality back in 2.19's editor. |
605e63b
to
4c2bfe6
Compare
I think a hotfix is justified. Then this pull request will have some meaning! |
2a63a22
to
ed7a347
Compare
@pstaabp can you check the keybindings on a mac. I updated to use the ones from codemirror 6. https://codemirror.net/docs/ref/#language.foldKeymap |
By default code mirror uses Shift-Ctrl-F for find/replace and Shift-Ctrl-G for find previous. These key bindings were overwritten when folding was added. This changes the fold binding to Shift-Ctrl-[ (or Shift-Cmd-[), fold all to Ctrl-Alt-[ (Cmd-Alt-[) and unfold all to Ctrl-Alt-] (Cmd-Alt-]), so they no longer interfere with the find/replace key bindings.
ed7a347
to
a816947
Compare
Ctrl-Shift-[ and -] switches tabs in Safari, so that's not good. Shift-Ctrl - [ and -] look to be open. |
Change key bindings for folding in PGCodeMirror. (Hotfix of #2594)
By default code mirror uses Shift-Ctrl-F for find/replace and Shift-Ctrl-G for find previous. These key bindings were overwritten when folding was added.
This changes the fold binding to Shift-Ctrl-W and unfold all to Shift-Ctrl-Q, so they no longer interfere with the find replace key bindings.
Note, I just picked key bindings close together, but if those who use folding have better suggestions, please share.