-
-
Notifications
You must be signed in to change notification settings - Fork 5k
-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
vim mode 'r <Enter>' keeps replace mode active #1246
Comments
Well, I'm seeing that typing 'r ' replaces the current character with the word 'Space', which is definitely a bug. I don't understand what you mean by using 'r ' to split lines though. Could you provide a more concrete example? |
sorry, yes. 'r ' replaces the character with Space, 'r' replaces the character with the word 'Down', etc. 'r' should replace the current character with a newline, which it does, but should also end replace mode. For example: hello world cursor is on the space between 'hello' and 'world', typing 'ri' should leave the buffer as hello and insert mode should be active. Instead, we get hello |
Got it, github is stripping out your But could you type out again the key sequence that results in hello Doing |
ah, sorry for the confusion. yes, so In the application I am using that uses codemirror the same keystrokes lead to |
@mightyguava I've added a few changes at vim.js:598 for that in my personal version of CodeMirror (not the one on github though), and planned to commit those here once I've got the current additions stable. In my version I actually explicitely catch the keys from |
@metatheos Awesome! I was planning to tackle this today but you got to it first :) You may need to special case Yes... visual mode handling is quite inelegant since CodeMirror's selection model is a little bit different from what would be expected of Vim. I believe I added a hack to include the last character in visual mode here https://github.com/metatheos/CodeMirror/blob/58e56150cb750840ddb27ed89a46c2d61819ef9e/keymap/vim.js#L875. Is it not working for you? I also thought you were planning in #1235 (comment) to keep a separate selection model and emulate CodeMirror selections with setSelection, which can go a long way to make this better. Or is that for later? |
You're right, I definitely have to adapt that for consistency. Vim-help actually states that it will insert only one linebreak if
I would need to check why it didn't work. I also could have added the same hack to
I would prefer to maybe add optional
|
This is fixed by the above change by @metatheos. Please verify and close. |
I use 'r ' to split lines and when I do so, my next keypress is taken as the character to use in the replace. The is also used, but replace mode remains active.
The text was updated successfully, but these errors were encountered: