diff options
Diffstat (limited to 'src/nvim')
-rw-r--r-- | src/nvim/eval.lua | 21 | ||||
-rw-r--r-- | src/nvim/optionstr.c | 9 |
2 files changed, 17 insertions, 13 deletions
diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 3f7294bcba..2984ce29c6 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -4368,32 +4368,31 @@ M.funcs = { The optional argument {opts} is a Dict and supports the following items: - type Specify the selection type + type Specify the region's selection type (default: "v"): "v" for |charwise| mode "V" for |linewise| mode "<CTRL-V>" for |blockwise-visual| mode exclusive If |TRUE|, use exclusive selection - for the end position 'selection'. + for the end position + (default: follow 'selection') You can get the last selection type by |visualmode()|. If Visual mode is active, use |mode()| to get the Visual mode (e.g., in a |:vmap|). - This function uses the line and column number from the - specified position. - It is useful to get text starting and ending in different - columns, such as |charwise-visual| selection. + This function is useful to get text starting and ending in + different columns, such as a |charwise-visual| selection. Note that: - Order of {pos1} and {pos2} doesn't matter, it will always return content from the upper left position to the lower right position. - - If 'virtualedit' is enabled and selection is past the end of - line, resulting lines are filled with blanks. - - If the selection starts or ends in the middle of a multibyte - character, it is not included but its selected part is - substituted with spaces. + - If 'virtualedit' is enabled and the region is past the end + of the lines, resulting lines are padded with spaces. + - If the region is blockwise and it starts or ends in the + middle of a multi-cell character, it is not included but + its selected part is substituted with spaces. - If {pos1} or {pos2} is not current in the buffer, an empty list is returned. diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c index 8ee81e4d4e..4be08b28f5 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -2100,8 +2100,13 @@ const char *did_set_showbreak(optset_T *args) /// The 'showcmdloc' option is changed. const char *did_set_showcmdloc(optset_T *args FUNC_ATTR_UNUSED) { - comp_col(); - return did_set_opt_strings(p_sloc, p_sloc_values, true); + const char *errmsg = did_set_opt_strings(p_sloc, p_sloc_values, false); + + if (errmsg == NULL) { + comp_col(); + } + + return errmsg; } int expand_set_showcmdloc(optexpand_T *args, int *numMatches, char ***matches) |