0
0
mirror of https://github.com/vim/vim.git synced 2025-10-22 08:34:29 -04:00

patch 9.1.1145: multi-line completion has wrong indentation for last line

Problem:  When expanding omni completion items with newlines (e.g.
          `then\n\t\nend`), the end statement gets wrong indentation.
Solution: Add OPENLINE_FORCE_INDENT flag to make open_line() use
          second_line_indent directly (glepnir)

closes: #16614

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Justin M. Keyes <justinkz@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
glepnir
2025-02-24 19:10:37 +01:00
committed by Christian Brabandt
parent 5b97947bbd
commit 5090a1fecb
9 changed files with 81 additions and 8 deletions

View File

@@ -1175,12 +1175,13 @@ extern int (*dyn_libintl_wputenv)(const wchar_t *envstring);
#define INSCHAR_COM_LIST 16 // format comments with list/2nd line indent
// flags for open_line()
#define OPENLINE_DELSPACES 0x01 // delete spaces after cursor
#define OPENLINE_DO_COM 0x02 // format comments
#define OPENLINE_KEEPTRAIL 0x04 // keep trailing spaces
#define OPENLINE_MARKFIX 0x08 // fix mark positions
#define OPENLINE_COM_LIST 0x10 // format comments with list/2nd line indent
#define OPENLINE_FORMAT 0x20 // formatting long comment
#define OPENLINE_DELSPACES 0x01 // delete spaces after cursor
#define OPENLINE_DO_COM 0x02 // format comments
#define OPENLINE_KEEPTRAIL 0x04 // keep trailing spaces
#define OPENLINE_MARKFIX 0x08 // fix mark positions
#define OPENLINE_COM_LIST 0x10 // format comments with list/2nd line indent
#define OPENLINE_FORMAT 0x20 // formatting long comment
#define OPENLINE_FORCE_INDENT 0x40 // use second_line_indent without indent logic
// There are five history tables:
#define HIST_CMD 0 // colon commands