Skip to content

Feat: Add 'wildoptions' flag to control search pattern completion style - #17667

Closed
girishji wants to merge 2 commits into
vim:masterfrom
girishji:newoption
Closed

girishji wants to merge 2 commits into
vim:masterfrom
girishji:newoption

Conversation

@girishji

@girishji girishji commented Jul 5, 2025 •

Copy link
Copy Markdown
Contributor

Based on #17665

Addresses #17654

+         exacttext
+                       When this flag is present, search pattern completion
+                       (e.g., in |/|, |?|, |:s|, |:g|, |:v|, and |:vim|)
+                       shows exact buffer text as menu items, without
+                       preserving regex artifacts like position
+                       anchors (e.g., |/\<|). This provides more intuitive
+                       menu items that match the actual buffer text. However,
+                       searches may be less accurate since the pattern is not
+                       preserved exactly.
+                       By default, Vim preserves the typed pattern (with
+                       anchors) and appends the matched word. This preserves
+                       search correctness, especially when using regular
+                       expressions or with 'smartcase' enabled. However, the
+                       case of the appended matched word may not exactly
+                       match the case of the word in the buffer.

@girishji

girishji commented Jul 5, 2025

Copy link
Copy Markdown
Contributor Author

Should the option value be search:exacttext to indicate it's specific to search pattern completion, or simply exacttext (if it is clear from the doc)?

@techntools

Copy link
Copy Markdown

I vote for exacttext

@chrisbra

chrisbra commented Jul 7, 2025

Copy link
Copy Markdown
Member

Thanks. Can you please rebase?

Addresses issue vim#17654

exacttext
      When this flag is present, search pattern completion
      (e.g., in |/|, |?|, |:s|, |:g|, |:v|, and |:vim|)
      shows exact buffer text as menu items, without
      preserving regex artifacts like position
      anchors (e.g., |/\<|). This provides more intuitive
      menu items that match the actual buffer text. However,
      searches may be less accurate since the pattern is not
      preserved exactly.
      By default, Vim preserves the typed pattern (with
      anchors) and appends the matched word. This preserves
      search correctness, especially when using regular
      expressions or with 'smartcase' enabled. However, the
      case of the appended matched word may not exactly
      match the case of the word in the buffer.
@girishji

girishji commented Jul 8, 2025

Copy link
Copy Markdown
Contributor Author

Rebased, please try.

@chrisbra chrisbra closed this in 93c2d5b Jul 8, 2025
@chrisbra

chrisbra commented Jul 8, 2025

Copy link
Copy Markdown
Member

thanks!

zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Jul 8, 2025
… case

Problem:  completion: search completion match may differ in case
          (techntools)
Solution: add "exacttext" to 'wildoptions' value (Girish Palya)

This flag does the following:

exacttext
      When this flag is present, search pattern completion
      (e.g., in |/|, |?|, |:s|, |:g|, |:v|, and |:vim|)
      shows exact buffer text as menu items, without
      preserving regex artifacts like position
      anchors (e.g., |/\<|). This provides more intuitive
      menu items that match the actual buffer text. However,
      searches may be less accurate since the pattern is not
      preserved exactly.
      By default, Vim preserves the typed pattern (with
      anchors) and appends the matched word. This preserves
      search correctness, especially when using regular
      expressions or with 'smartcase' enabled. However, the
      case of the appended matched word may not exactly
      match the case of the word in the buffer.

fixes: vim/vim#17654
closes: vim/vim#17667

vim/vim@93c2d5b

Co-authored-by: Girish Palya <[email protected]>
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Jul 9, 2025
… case

Problem:  completion: search completion match may differ in case
          (techntools)
Solution: add "exacttext" to 'wildoptions' value (Girish Palya)

This flag does the following:

exacttext
      When this flag is present, search pattern completion
      (e.g., in |/|, |?|, |:s|, |:g|, |:v|, and |:vim|)
      shows exact buffer text as menu items, without
      preserving regex artifacts like position
      anchors (e.g., |/\<|). This provides more intuitive
      menu items that match the actual buffer text. However,
      searches may be less accurate since the pattern is not
      preserved exactly.
      By default, Vim preserves the typed pattern (with
      anchors) and appends the matched word. This preserves
      search correctness, especially when using regular
      expressions or with 'smartcase' enabled. However, the
      case of the appended matched word may not exactly
      match the case of the word in the buffer.

fixes: vim/vim#17654
closes: vim/vim#17667

vim/vim@93c2d5b

Co-authored-by: Girish Palya <[email protected]>
@girishji

girishji commented Jul 9, 2025

Copy link
Copy Markdown
Contributor Author

Thanks.

@girishji
girishji deleted the newoption branch July 12, 2025 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants