1
0
forked from aniani/vim

813 Commits

Author SHA1 Message Date
Christian Brabandt
f22580e57c
runtime(doc): update a few minor omissions from 5876016 and 4d2c4b9
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-14 12:05:52 +01:00
glepnir
587601671c
patch 9.1.1201: 'completefuzzycollect' does not handle dictionary correctly
Problem:  'completefuzzycollect' does not handle dictionary correctly
Solution: check for ctrl_x_mode_dictionary (glepnir)

closes: #16867

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-13 21:39:51 +01:00
zeertzjq
1dc731a49f
runtime(doc): make :h 'completefuzzycollect' a bit clearer
- Fix grammar
- Use "matches" instead of "items" ("completion candidates" is used in
  some other places, but it's a bit verbose)
- "When set" is a bit vague, instead use "For specified modes"

closes: #16871

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-13 21:30:43 +01:00
glepnir
53b14578e0
patch 9.1.1197: process_next_cpt_value() uses wrong condition
Problem:  process_next_cpt_value() uses wrong condition
Solution: use cfc_has_mode() instead and remove redundant else if branch
          (glepnir)

closes: #16833

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-12 21:28:39 +01:00
zeertzjq
53d59ecc1d
patch 9.1.1182: No cmdline completion for 'completefuzzycollect'
Problem:  No cmdline completion for the 'completefuzzycollect' option
          (after v9.1.1178)
Solution: Add cmdline completion for the 'completefuzzycollect' option,
          improve its description in optwin.vim (zeertzjq).

closes: #16813

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-07 19:09:09 +01:00
glepnir
f31cfa29bf
patch 9.1.1178: not possible to generate completion candidates using fuzzy matching
Problem:  not possible to generate completion candidates using fuzzy
          matching
Solution: add the 'completefuzzycollect' option for (some) ins-completion
          modes (glepnir)

fixes #15296
fixes #15295
fixes #15294
closes: #16032

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-06 21:59:13 +01:00
zeertzjq
659cb28c25
runtime(doc): fix typo "bet" in :h 'completeopt'
closes: #16773

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-03 20:18:04 +01:00
Girish Palya
2bacc3e5fb
patch 9.1.1166: command-line auto-completion hard with wildmenu
Problem:  command-line auto-completion hard with wildmenu
Solution: implement "noselect" wildoption value (Girish Palya)

When `noselect` is present in `wildmode` and 'wildmenu' is enabled, the
completion menu appears without pre-selecting the first item.

This change makes it easier to implement command-line auto-completion,
where the menu dynamically appears as characters are typed, and `<Tab>`
can be used to manually select an item. This can be achieved by
leveraging the `CmdlineChanged` event to insert `wildchar(m)`,
triggering completion menu.

Without this change, auto-completion using the 'wildmenu' mechanism is
not feasible, as it automatically inserts the first match, preventing
dynamic selection.

The following Vimscript snippet demonstrates how to configure
auto-completion using `noselect`:

```vim
vim9script
set wim=noselect:lastused,full wop=pum wcm=<C-@> wmnu
autocmd CmdlineChanged : timer_start(0, function(CmdComplete, [getcmdline()]))

def CmdComplete(cur_cmdline: string, timer: number)
  var [cmdline, curpos] = [getcmdline(), getcmdpos()]
  if cur_cmdline ==# cmdline  # Avoid completing each character in keymaps and pasted text
    && !pumvisible() && curpos == cmdline->len() + 1

    if cmdline[curpos - 2] =~ '[\w*/:]'  # Reduce noise by completing only selected characters
      feedkeys("\<C-@>", "ti")
      set eventignore+=CmdlineChanged  # Suppress redundant completion attempts
      timer_start(0, (_) => {
        getcmdline()->substitute('\%x00$', '', '')->setcmdline()  # Remove <C-@> if no completion items exist
        set eventignore-=CmdlineChanged
      })
    endif
  endif
enddef
```

fixes: #16551
closes: #16759

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-02 23:02:42 +01:00
glepnir
94a045ed56
patch 9.1.1161: preinsert requires bot "menu" and "menuone" to be set
Problem:  preinsert requires bot "menu" and "menuone" to be set,
          but "menu" is redundant (after v9.1.1160)
Solution: preinsert only requires menuone (glepnir)

closes: #16763

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-01 16:12:23 +01:00
glepnir
a2c5559f29
patch 9.1.1160: Ctrl-Y does not work well with "preinsert" when completing items
Problem:  The 'preinsert' feature requires Ctrl-Y to confirm insertion,
          but Ctrl-Y only works when the popup menu (pum) is displayed.
          Without enforcing this dependency, it could lead to confusing
          behavior or non-functional features.

Solution: Modify ins_compl_has_preinsert() to check for both 'menu' and
          'menuone' flags when 'preinsert' is set. Update documentation
          to clarify this requirement. This avoids adding complex
          conditional behaviors. (glepnir)

fixes: #16728
closes: #16753

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-28 17:43:42 +01:00
zeertzjq
85a50fe825
runtime(doc): fix confusing docs for 'completeitemalign'
closes: #16743

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-27 19:24:32 +01:00
Christian Brabandt
27822a0441
patch 9.1.1114: enabling termguicolors automatically confuses users
Problem:  enabling termguicolors automatically confuses users. Since
          querying the terminal for the RGB flag happens asynchronously,
          enabling termguicolors is noticeable by users as the highlighting changes
          and is therefore unexpected.
          (after v9.1.1054)
Solution: comment out that part for now. We may need another way to
          enable this in the future.

fixes: #16539
fixes: #16568
fixes: #16649

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-16 09:30:00 +01:00
Luuk van Baal
b7147f8236
patch 9.1.1084: Unable to persistently ignore events in a window and its buffers
Problem:  Unable to persistently ignore events in a window and its buffers.
Solution: Add 'eventignorewin' option to ignore events in a window and buffer
          (Luuk van Baal)

Add the window-local 'eventignorewin' option that is analogous to
'eventignore', but applies to a certain window and its buffers. Identify
events that should be allowed in 'eventignorewin', adapt "auto_event"
and "event_tab" to encode this information. Window context is not passed
onto apply_autocmds_group(), and when to ignore an event is a bit
ambiguous when "buf" is not "curbuf", rather than a large refactor, only
ignore an event when all windows into "buf" are ignoring the event.

closes: #16530

Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-08 18:52:39 +01:00
Hirohito Higashi
195fcc90d0
runtime(doc): Tweak documentation style a bit
closes: #16556

Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
2025-02-01 10:26:58 +01:00
Christian Brabandt
d7f5854fcc
patch 9.1.1060: Vim always enables 'termguicolors' in a terminal
Problem:  Vim always enables 'termguicolors' in a terminal, even
          when not wanted (after v9.1.1054)
Solution: Respect `:set notermguicolors` in vimrc file

fixes: #16538
fixes: #16539
closes: #16540

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-31 16:16:48 +01:00
glepnir
edd4ac3e89
patch 9.1.1056: Vim doesn't highlight to be inserted text when completing
Problem:  Vim doesn't highlight to be inserted text when completing
Solution: Add support for the "preinsert" 'completeopt' value
          (glepnir)

Support automatically inserting the currently selected candidate word
that does not belong to the latter part of the leader.

fixes: #3433
closes: #16403

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-29 18:58:04 +01:00
Christian Brabandt
279dd703e1
patch 9.1.1054: Vim doesn't work well with TERM=xterm-direct
Problem:  Vim doesn't work well with TERM=xterm-direct
          (Andrea Pappacoda)
Solution: detect if a terminal supports true-colors and
          enable termguicolors

The terminfo database for xterm-direct contains both the (non-standard)
termcap RGB capability and a number of colors == 0x1000000 so it seems
either of those two options can be used to detect a terminal capable of
displaying true colors.

So set the termguicolor option automatically, when either of the two
options is detected. (for some reasons, my debian xterm (v393) does not
respond to XTGETTCAP query attempts, so falling back to the number of
colors seems like a good compromize)

fixes: #16327
closes: #16490

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-26 10:53:17 +01:00
glepnir
f400a0cc41
patch 9.1.1049: insert-completed items are always sorted
Problem:  insert-completed items are always sorted, although the LSP
          spec[1] standard defines sortText in the returned
          completionitem list. This means that the server has sorted the
          results. When fuzzy is enabled, this will break the server's
          sorting results.
Solution: disable sorting of candidates when "nosort" is set in
          'completeopt'

[1]
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionItem

closes: #16501

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-23 19:59:28 +01:00
Christian Brabandt
d9a1f267ba
patch 9.1.1044: Vim9: Patch 9.1.1014 causes regressions
Problem:  Vim9: Patch 9.1.1014 causes regressions
Solution: revert it for now

This reverts commit 57f0119358ed7f060d5020309b9043463121435f since this
causes some regressions:
https://github.com/vim/vim/pull/16440#issuecomment-2600235629

So revert "patch 9.1.1014: Vim9: variable not found in transitive
import" for now.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-21 22:17:50 +01:00
Jon Parise
71028a32db
runtime(doc): rename last t_BG reference to t_RB
This was missed in 37c64c78fd87e086b5a945ad7032787c274e2dcb.

closes: #16491

Signed-off-by: Jon Parise <jon@indelible.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-20 20:19:18 +01:00
Hirohito Higashi
57f0119358
patch 9.1.1014: Vim9: variable not found in transitive import
Problem:  Vim9: variable not found in transitive import
Solution: Allow nested import (Hirohito Higashi)

fixe: #16379
closes: #16440

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-14 17:21:42 +01:00
Jonathon
7c7a4e6d1a
patch 9.1.1009: diff feature can be improved
Problem:  diff feature can be improved
Solution: include the linematch diff alignment algorithm
          (Jonathon)

closes: #9661

Signed-off-by: Jonathon <jonathonwhite@protonmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-12 09:58:00 +01:00
glepnir
ad409876d9
patch 9.1.1001: ComplMatchIns highlight hard to read on light background
Problem:  ComplMatchIns highlight hard to read on light background
          (after v9.1.0996)
Solution: define the highlighting group cleared, it should be configured in
          colorschemes separately (glepnir)

closes: #16414

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-10 20:08:20 +01:00
Christian Brabandt
f6ba8defc6
runtime(doc): update for new keyprotocol option value (after v9.1.0969)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-12-28 17:15:05 +01:00
Christian Brabandt
ed89206efe
runtime(doc): add a note about inclusive motions and exclusive selection
related: #16202

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-12-14 20:23:39 +01:00
zeertzjq
8cc43daee1
patch 9.1.0911: Variable name for 'messagesopt' doesn't match short name
Problem:  Variable name for 'messagesopt' doesn't match short name
          (after v9.1.0908)
Solution: Change p_meo to p_mopt.  Add more details to docs.
          (zeertzjq)

closes: #16182

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-12-07 16:09:08 +01:00
Shougo Matsushita
d9e9f89e0f
patch 9.1.0910: 'messagesopt' does not check max wait time
Problem:  'messagesopt' does not check max wait time
          (after v9.1.0908)
Solution: Check for max wait value
          (Shougo Matsushita)

closes: #16183

Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-12-07 16:00:25 +01:00
Christian Brabandt
51d4d84d6a
patch 9.1.0908: not possible to configure :messages
Problem:  not possible to configure :messages
Solution: add the 'messagesopt' option (Shougo Matsushita)

closes: #16068

Co-authored-by: h_east <h.east.727@gmail.com>
Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-12-06 17:26:25 +01:00
h-east
b534e80008
runtime(doc): Tweak documentation style a bit
closes: #16164

Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-12-03 20:38:30 +01:00
dundargoc
768728b487
runtime(doc): Update documentation for "noselect" in 'completeopt'
In particular, make the distinction and interaction between "noinsert"
and "noselect" clearer as it was very confusing before.

closes: #16148

Signed-off-by: dundargoc <gocdundar@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-12-01 20:06:42 +01:00
Luca Saccarola
959ef61430
patch 9.1.0899: default for 'backspace' can be set in C code
Problem:  default for 'backspace' can be set in C code
Solution: promote the default for 'backspace' from defaults.vim to the C
          code (Luca Saccarola)

closes: #16143

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-12-01 16:25:53 +01:00
Luca Saccarola
c0d30eff6d
patch 9.1.0895: default history value is too small
Problem:  default history value is too small
Solution: promote the change from defaults.vim back to
          the C core, so increase the default 'history' option value
          from 50 to 200 (Lucca Saccarola)

closes: #16129

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-28 22:27:28 +01:00
Yegappan Lakshmanan
ac023e8baa
patch 9.1.0890: %! item not allowed for 'rulerformat'
Problem:  %! item not allowed for 'rulerformat'
          (yatinlala)
Solution: also allow to use %! for rulerformat option
          (Yegappan Lakshmanan)

fixes: #16091
closes: #16118

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-27 20:55:45 +01:00
Shougo Matsushita
9f860a14c3
patch 9.1.0883: message history cleanup is missing some tests
Problem:  message history cleanup is missing some tests
Solution: Add tests, refactor common code into did_set_msghistory()
          (Shougo Matsushita)

closes: #16078

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Milly <milly.ca@gmail.com>
Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-24 13:48:05 +01:00
Shougo Matsushita
4bd9b2b246
patch 9.1.0864: message history is fixed to 200
Problem:  message history is fixed to 200
Solution: Add the 'msghistory' option, increase the default
          value to 500 (Shougo Matsushita)

closes: #16048

Co-authored-by: Milly <milly.ca@gmail.com>
Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-14 22:34:24 +01:00
Luca Saccarola
437bc13ea1
patch 9.1.0862: 'wildmenu' not enabled by default in nocp mode
Problem:  'wildmenu' not enabled by default in nocp mode
Solution: promote the default Vim value to true, it has been enabled
          in defaults.vim anyhow, so remove it there (Luca Saccarola)

closes: #16055

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-14 21:21:17 +01:00
Yee Cheng Chin
39cd9061b1
runtime(doc): update default value for fillchars option
closes: #15998

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-06 20:20:57 +01:00
Yegappan Lakshmanan
a13f3a4f5d
patch 9.1.0831: 'findexpr' can't be used as lambad or Funcref
Problem:  'findexpr' can't be used for lambads
          (Justin Keyes)
Solution: Replace the findexpr option with the findfunc option
          (Yegappan Lakshmanan)

related: #15905
closes: #15976

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-02 18:43:42 +01:00
zeertzjq
20e045f781
patch 9.1.0821: 'findexpr' completion doesn't set v:fname to cmdline argument
Problem:  'findexpr' completion doesn't set v:fname to cmdline argument.
Solution: Set v:fname to the cmdline argument as-is (zeertzjq).

closes: #15934

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-28 22:05:26 +01:00
Yegappan Lakshmanan
2f6efaccfd
patch 9.1.0811: :find expansion does not consider 'findexpr'
Problem:  :find expansion does not consider 'findexpr'
Solution: Support expanding :find command argument using 'findexpr'
          (Yegappan Lakshmanan)

closes: #15929

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-23 21:06:10 +02:00
Yegappan Lakshmanan
aeb1c97db5
patch 9.1.0810: cannot easily adjust the |:find| command
Problem:  cannot easily adjust the |:find| command
Solution: Add support for the 'findexpr' option (Yegappan Lakshmanan)

closes: #15901
closes: #15905

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-22 23:42:20 +02:00
Yee Cheng Chin
92b59c628a
runtime(doc): Fix wrong Mac default options
Clean up docs for macOS defaults. Simply use "Unix" across the board
instead of being inconsistent and occasionally using "Unix, macOS". Also
remove stale defaults that were erroneously renamed to "macOS" from
"Macintosh" when they were actually referring to Mac OS 9 which is no
longer supported.

closes: #15924

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-22 21:16:43 +02:00
Milly
6c2fc377bf
runtime(help): Update help syntax
This commit makaes the following changes to the vim help syntax:

- fix excessive URL detection in help, because `file:{filename}` in
  doc/options.txt is determined to be a URL.
- update highlighting N for :resize in help
- split Italian-specific syntax into separate help script
- highlight `Note` in parentheses in help
- update 'titlestring' behaviour in documentation for invalid '%' format

closes: #15883

Signed-off-by: Milly <milly.ca@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-16 22:11:17 +02:00
Christian Brabandt
5bcfb5a30c
runtime(doc): add some docs for file-watcher programs
fixes: #15733

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-14 22:08:22 +02:00
saher
7b5e52d16f
runtime(doc): add preview flag to statusline example
Problem:  The standard statusline example is missing the preview flag
          "%w"
Solution: Add the preview flag "%w"

closes: #15874

Signed-off-by: saher <msaher.shair@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-14 19:52:50 +02:00
Christian Brabandt
fd4e47e06b
runtime(doc): clarify the effect of 'startofline' option
fixes: #15794

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-06 18:02:45 +02:00
Milly
a9c6f90918
patch 9.1.0762: 'cedit', 'termwinkey' and 'wildchar' may not be parsed correctly
Problem:  'cedit', 'termwinkey' and 'wildchar' may not be parsed
          correctly
Solution: improve string_to_key() function in option.c
          (Milly)

- Problem: `^@` raises an error.
  Solution: Store as `<Nul>`.
- Problem: `<t_xx` does not raise an error.
  Solution: Raise an error if closing `>` is missing.
- Problem: Single `<` or `^` raises an error. It is inconvenient for users.
  Solution: They are stored as a single character.

closes: #15811

Signed-off-by: Milly <milly.ca@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-06 16:47:02 +02:00
Milly
ae62fe5c28
runtime(doc): 'filetype', 'syntax' and 'keymap' only allow alphanumeric + some characters
closes: #15783

Signed-off-by: Milly <milly.ca@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-02 19:36:03 +02:00
glepnir
6a89c94a9e
patch 9.1.0754: fixed order of items in insert-mode completion menu
Problem:  fixed order of items in insert-mode completion menu
Solution: Introduce the 'completeitemalign' option with default
          value "abbr,kind,menu" (glepnir).

Adding an new option `completeitemalign` abbr is `cia` to custom
the complete-item order in popupmenu.

closes: #14006
closes: #15760

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-01 20:32:12 +02:00
Milly
25732435c5
patch 9.1.0752: can set 'cedit' to an invalid value
Problem:  can set cedit to an invalid value
Solution: Check that the value is a valid key name
          (Milly)

closes: #15778

Signed-off-by: Milly <milly.ca@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-01 19:33:39 +02:00