patch 9.1.1176: wrong indent when expanding multiple lines
Commit:
https://github.com/vim/vim/commit/34a7d82aaed9836174f4ea84af047db3fdf6c8b3
Author: glepnir <[email protected]>
Date: Wed Mar 5 21:18:20 2025 +0100
patch 9.1.1176: wrong indent when expanding multiple lines
Problem: wrong indentation of lastline when expanding multiple lines
Solution: Check OPENLINE_FORCE_INDENT flag in open_line() (glepnir)
closes: #16786
Signed-off-by: glepnir <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/src/change.c b/src/change.c
index a3329bdcb..9d1b23745 100644
--- a/src/change.c
+++ b/src/change.c
@@ -1672,7 +1672,8 @@ open_line(
)
&& in_cinkeys(dir == FORWARD
? KEY_OPEN_FORW
- : KEY_OPEN_BACK, ' ', linewhite(curwin->w_cursor.lnum));
+ : KEY_OPEN_BACK, ' ', linewhite(curwin->w_cursor.lnum))
+ && !(flags & OPENLINE_FORCE_INDENT);
// Find out if the current line starts with a comment leader.
// This may then be inserted in front of the new line.
diff --git a/src/testdir/dumps/Test_pum_with_special_characters_13.dump
b/src/testdir/dumps/Test_pum_with_special_characters_13.dump
new file mode 100644
index 000000000..de505d27d
--- /dev/null
+++ b/src/testdir/dumps/Test_pum_with_special_characters_13.dump
@@ -0,0 +1,12 @@
+|m+0#ff404010#ffffff0|y| +0#0000000&@72
+| +0#ff404010&@7|m|u|l|t|i| +0#0000000&@61
+|l+0#ff404010&|i|n|e> +0#0000000&@70
+|m+0#0000001#e0e0e08|y|^|@| @1|m|u|l|t|i|^|@|l|i|n|e| @2|
+0#4040ff13#ffffff0@54
+|m+0#0000001#ffd7ff255|y|^|@| @3|m|u|l|t|i|^|@|l|i|n|e| |
+0#4040ff13#ffffff0@54
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@62
diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim
index 82d2ef0be..aa4e3e411 100644
--- a/src/testdir/test_popup.vim
+++ b/src/testdir/test_popup.vim
@@ -1905,6 +1905,7 @@ func Test_pum_complete_with_special_characters()
return [#{word: "func ()
end", abbr: "function ()",}, #{word: "foobar"}, #{word: "你好
我好"}]
endfunc
set omnifunc=Omni_test
+ inoremap <F5> <Cmd>call complete(col('.'), [ "my
multi
line", "my
multi
line" ])<CR>
END
call writefile(lines, 'Xpreviewscript', 'D')
@@ -1963,6 +1964,14 @@ func Test_pum_complete_with_special_characters()
call TermWait(buf, 50)
call VerifyScreenDump(buf, 'Test_pum_with_special_characters_12', {})
+ call term_sendkeys(buf, "\<ESC>ggVGd")
+ call term_sendkeys(buf, ":filetype indent on\<CR>")
+ call term_sendkeys(buf, ":set nocompatible autoindent& shiftwidth&
tabstop&\<CR>")
+ call term_sendkeys(buf, ":setlocal ft=lua\<CR>")
+ call term_sendkeys(buf, "S\<F5>")
+ call TermWait(buf, 50)
+ call VerifyScreenDump(buf, 'Test_pum_with_special_characters_13', {})
+
call StopVimInTerminal(buf)
endfunc
diff --git a/src/version.c b/src/version.c
index 6553fa4fd..65c716929 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1176,
/**/
1175,
/**/
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1tpvNU-00Adn2-4J%40256bit.org.