-
-
Notifications
You must be signed in to change notification settings - Fork 5.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
ex: fix newline escaping #15120
ex: fix newline escaping #15120
Conversation
2de90ca
to
3b2435a
Compare
3b2435a
to
0f6a29c
Compare
This fixes newline escaping to allow passing multiple commands to ":global", multiple lines to shell commands, and ending lines in append mode with backslashes. This reverts a previous incorrect attempt to fix append mode which removed half of trailing backslashes which lead to, eg. the following two commands being parsed as having a different number of backslashes: ``` !echo foo\\\ ``` ``` !echo foo\\ \ ```
0f6a29c
to
7436b76
Compare
The fix for this turned out to be much simpler. The culprit was 417f5e7, so ex mode has been broken for around 14 years... |
Thanks! |
Does this just revert 7.3.014? |
It is resolved. We fix it correctly by not interpreting backslashes at all in insert mode. |
related: vim#15120 Signed-off-by: Mohamed Akram <mohd.akram@outlook.com>
related: vim#15120 Signed-off-by: Mohamed Akram <mohd.akram@outlook.com>
It's not completely reverted, there is an added check for There were some discussions around 7.3.014: https://groups.google.com/g/vim_dev/c/F5-tDqoafz8/m/GqKF-uQsLD0J The example mentioned in this thread:
This works now correctly. Should probably turn this into a test as well. |
Problem: Not enough tests for what v9.1.0535 fixed Solution: Add another test for ex-mode This comes from: https://groups.google.com/g/vim_dev/c/F5-tDqoafz8/m/GqKF-uQsLD0J related: #15120 Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: newline escape wrong in ex mode (Konrad Schwarz) Solution: partly revert patch 7.3.014, remove backslash in front of a newline when not in prompt mode in ex line mode (Mohamed Akram) This fixes newline escaping to allow passing multiple commands to ":global", multiple lines to shell commands, and ending lines in append mode with backslashes. This should fix a POSIX/(traditional) VI incompatiblity. This reverts a previous incorrect attempt at patch v7.3.014 to fix append mode which removed half of trailing backslashes which lead to, eg. the following two commands being parsed as having a different number of backslashes: ``` !echo foo\\\ ``` ``` !echo foo\\ \ ``` fixes: vim#6135 fixes: vim#7244 closes: vim#15120 Signed-off-by: Mohamed Akram <mohd.akram@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Not enough tests for what v9.1.0535 fixed Solution: Add another test for ex-mode This comes from: https://groups.google.com/g/vim_dev/c/F5-tDqoafz8/m/GqKF-uQsLD0J related: vim#15120 Signed-off-by: Christian Brabandt <cb@256bit.org>
related: vim/vim#15120 closes: vim/vim#15228 vim/vim@74703f1 Co-authored-by: Mohamed Akram <mohd.akram@outlook.com>
related: vim/vim#15120 closes: vim/vim#15228 vim/vim@74703f1 Nvim only supports Vim Ex mode, so this is long obsolete in Nvim. Co-authored-by: Mohamed Akram <mohd.akram@outlook.com>
…29678) related: vim/vim#15120 closes: vim/vim#15228 vim/vim@74703f1 Nvim only supports Vim Ex mode, so this is long obsolete in Nvim. Co-authored-by: Mohamed Akram <mohd.akram@outlook.com>
related: vim#15120 Signed-off-by: Mohamed Akram <mohd.akram@outlook.com>
…29678) related: vim/vim#15120 closes: vim/vim#15228 vim/vim@74703f1 Nvim only supports Vim Ex mode, so this is long obsolete in Nvim. Co-authored-by: Mohamed Akram <mohd.akram@outlook.com> (cherry picked from commit 10256bb)
…29702) related: vim/vim#15120 closes: vim/vim#15228 vim/vim@74703f1 Nvim only supports Vim Ex mode, so this is long obsolete in Nvim. Co-authored-by: Mohamed Akram <mohd.akram@outlook.com>
This fixes newline escaping to allow passing multiple commands to ":global", multiple lines to shell commands, and ending lines in append mode with backslashes. This reverts a previous incorrect attempt to fix append mode which removed half of trailing backslashes which lead to, eg. the following two commands being parsed as having a different number of backslashes:
Fixes #6135
Fixes #7244
@konrad-schwarz