Commit Graph

7632 Commits

Author SHA1 Message Date
Christian Clason
80eda9726f docs(lua): clarify assumptions on luajit vs. puc lua
Problem: Plugin authors and distribution packagers are confused about
the role of LuaJIT vs. PUC Lua.

Solution: Clarify that LuaJIT is preferred but not required (extensions
should not be assumed but checked for) and that vanilla Lua 5.1 should
be used without language extensions such as `goto`.
2024-07-21 16:11:28 +02:00
Christian Clason
e1b7fa2a3a vim-patch:6e37575: runtime(mysql): update syntax script
Problem:

- `syn region ...`s in syntax/mysql.vim match function names inaccurately.
- no syntax rules for mysql window function.
- coarse highlight definition in syntax/mysql.vim.

Solution:

- add `\<` before the function name for accuracy.
- add syntax rules for mysql window function.
- enhance the highlight definition.

closes: vim/vim#15311

6e37575760

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-07-21 14:14:53 +02:00
Christian Clason
a5d5b9f36b vim-patch:aa49512: runtime(yaml): Fix flow mapping key detection
fixes: vim/vim#15196
closes: vim/vim#15313

aa495124f8

Co-authored-by: itchyny <itchyny@cybozu.co.jp>
2024-07-21 14:14:53 +02:00
Christian Clason
5fc25ecc7a vim-patch:4aa6b52: runtime(kconfig): Update syntax script and remove syn sync
fixes: vim/vim#15306

4aa6b52e82

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-20 12:59:07 +02:00
Christian Clason
2a24d0a435 vim-patch:9.1.0603: filetype: use correct extension for Dracula
Problem:  pattern detection for Dracula language uses "*lvs" and "*lpe".
          as there is no dot, those are not treated as extensions which
          they should (judging by 'runtime/syntax/dracula.vim' and
          common sense).
Solution: use "*.lvs" and "*.lpe" patterns (Evgeni Chasnovski)

closes: vim/vim#15303

5fb801a74f

Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
2024-07-19 17:28:48 +02:00
zeertzjq
f67a7365af vim-patch:9.1.0602: filetype: Prolog detection can be improved
Problem:  filetype: Prolog detection can be improved
Solution: update the prolog detection regex
          (igna_martinoli)

related: vim/vim#10835
related: vim/vim#15206
closes: vim/vim#15253

37853b7de3

N/A patch:

vim-patch:7347642: runtime(filetype): Fix Prolog file detection regex

Problem: filetype: .pro file detection for Prolog is broken
Solution: fixed the regex to only match on the tested
          cases (igna_martinoli)

fixes: vim/vim#10835
closes: vim/vim#15206

7347642633

Co-authored-by: igna_martinoli <ignamartinoli@protonmail.com>
Co-authored-by: clason <c.clason@uni-graz.at>
2024-07-19 14:42:02 +08:00
Christian Clason
e54f503c44 vim-patch:4266daa: runtime(mermaid): correct wrong comment options
fixes: vim/vim#15279

4266daae17

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-19 08:17:47 +02:00
zeertzjq
adef830f83
vim-patch:99984fc: runtime(vim): Update base-syntax, improve :map highlighting (#29795)
Match :map ( RHS properly.

Only match ! after :map, :noremap, :unmap and :mapclear.

closes: vim/vim#15297

99984fc58a

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-07-19 04:16:20 +00:00
zeertzjq
f73904f9d6
vim-patch:eb6d733: runtime(doc): fix more inconsistencies in assert function docs (#29796)
related: https://github.com/vim/vim/pull/15280#issuecomment-2233771449

closes: vim/vim#15285

eb6d733bef
2024-07-19 04:12:13 +00:00
zeertzjq
0b710c8e55
vim-patch:9.1.0599: Termdebug: still get E1023 when specifying arguments (#29794)
Problem:  Termdebug: still get E1023 when specifying arguments and using
          a prompt buffer.
Solution: Use empty() instead of len().  Add a test.  Fix wrong order of
          arguments to assert_equal() in Test_termdebug_basic().
          (zeertzjq)

closes: vim/vim#15288

aef6179bcf
2024-07-19 03:48:13 +00:00
Evgeni Chasnovski
f61efe3fe7
perf(filetype): implement parent pattern pre-matching (#29660)
Problem: calling `vim.filetype.match()` has performance bottleneck in
  that it has to match a lot of Lua patterns against several versions of
  input file name. This might be the problem if users need to call it
  synchronously a lot of times.

Solution: add "parent pattern pre-matching" which can be used to quickly
  reject several potential pattern matches at (usually rare) cost of
  adding time for one extra Lua pattern match.

  "Parent pattern" is a manually added/tracked grouping of filetype
  patterns which should have two properties:
    - Match at least the same set of strings as its filetype patterns.
      But not too much more.
    - Be fast to match.

  For them to be effective, group should consist from at least three
  filetype patterns.

  Example: for a filetpye pattern ".*/etc/a2ps/.*%.cfg", both "/etc/"
  and "%.cfg" are good parent patterns (prefer the one which can group
  more filetype patterns).

  After this commit, `vim.filetype.match()` on most inputs runs ~3.4
  times faster (while some inputs may see less impact if they match
  many parent patterns).
2024-07-18 10:26:27 -05:00
Christian Clason
c69ea53c9d
vim-patch:9.1.0596: filetype: devscripts config files are not recognized (#29773)
Problem:  filetype: Debian devscripts config files are not recognized
Solution: detect devscripts.conf and .devscripts files as sh filetype
          (sourced by /bin/sh)

closes: vim/vim#15227

76c19028ff

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-07-18 07:13:16 +00:00
Christian Clason
f69cfc6712 vim-patch:1724ddb: runtime(sdc): update syntax to SDC-standard 2.1
Looking into the current standard for Synopsis Design Constraints (SDC)
from their [Technology Access
Program](https://www.synopsys.com/community/interoperability-programs/tap-in.html),
one can see that the current state of the sdc-syntax file is very
outdated as well as short in coverage of keywords.

This commit pursues to add all the missing keywords from the current
standard (Rev. 2.1).

closes: vim/vim#15281

1724ddbe3a

Co-authored-by: daniel-s-w <59746710+daniel-s-w@users.noreply.github.com>
2024-07-18 08:48:24 +02:00
zeertzjq
be7b577453 vim-patch:27f5334: runtime(termdebug): quote filename arguments using double quotes
closes: vim/vim#15270

27f53346a3

Co-authored-by: Ubaldo Tiberi <ubaldo.tiberi@google.com>
2024-07-18 13:28:12 +08:00
zeertzjq
8ce85d5fc7 vim-patch:c3837a4: runtime(termdebug): fix a few issues
Fix a few minor issues:
1. filename with whitespaces issue should be fixed now, fixes: vim/vim#12357
2. ":Termdebug args" should work now, fixes: vim/vim#15254

closes: vim/vim#15261

c3837a46ff

Omit the DeleteCommands() change as it isn't really an improvement.

Co-authored-by: Ubaldo Tiberi <ubaldo.tiberi@google.com>
2024-07-18 13:21:22 +08:00
zeertzjq
c909efb96f vim-patch:83d0028: runtime(termdebug): Use string interpolation instead of string concat
closes: vim/vim#14972

83d0028026

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-07-18 11:50:32 +08:00
zeertzjq
167d0e5a6c
vim-patch:d65e58f: runtime(vim): Update base-syntax, match types in Vim9 variable declarations (#29780)
Match types in Vim9 variable declarations.

Match Vim9 boolean and null literals. These are not matched in all
contexts yet.

related: vim/vim#15277

d65e58f6f9

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-07-18 01:08:47 +00:00
zeertzjq
18f1a3aaa5
vim-patch:c1b3984: runtime(doc): minor updates. (#29778)
closes: vim/vim#15280

c1b3984a7b

Co-authored-by: Shane Harper <shane@shaneharper.net>
2024-07-18 08:08:56 +08:00
Amit Singh
e29f245a10
fix(lsp): inlay hints are rendered in the correct order (#29707)
Problem:
When there are multiple inlay hints present at the same position, they
should be rendered in the order they are received in the response from
LSP as per the LSP spec. Currently, this is not respected.

Solution:
Gather all hints for a given position, and then set it in a single
extmark call instead of multiple set_extmark calls. This leads to fewer
extmark calls and correct inlay hints being rendered.
2024-07-17 16:44:53 +02:00
Riley Bruins
05dcda8f9b fix(treesitter): recognize aliased parsers in omnifunc, query linter
**Problem:** A query file for something like `html_tags` will not be
given html node completion

**Solution:** Check for parser aliases before offering completions

Co-authored-by: Lewis Russell <me@lewisr.dev>
2024-07-17 12:13:53 +02:00
Christian Clason
c7b0334cea vim-patch:3698fbb: runtime(tsv): include simple syntax plugin
fixes: vim/vim#15271

3698fbbd7c

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-17 11:11:58 +02:00
Christian Clason
8e590cae83 vim-patch:9.1.0593: filetype: Asymptote files are not recognized
Problem:  filetype: Asymptote files are not recognized
Solution: detect '*.asy' files as asy filetype, include
          ftplugin and syntax plugin (AvidSeeker).

Reference: https://asymptote.sourceforge.io/

closes: vim/vim#15252

3088ef094d

Co-authored-by: AvidSeeker <avidseeker7@protonmail.com>
2024-07-17 11:11:58 +02:00
Christian Clason
498d9beed9 vim-patch:babea52: runtime(gomod): add recommended indent options to ftplugin
closes: vim/vim#15264

babea52f4d

Co-authored-by: markmacode <code@mamo.aleeas.com>
2024-07-17 11:11:58 +02:00
Christian Clason
5d8220bda0 vim-patch:3e07d5a: runtime(go): add recommended indent options to ftplugin
related: vim/vim#15264

3e07d5aef1

Co-authored-by: markmacode <code@mamo.aleeas.com>
2024-07-17 11:11:58 +02:00
Christian Clason
c146580e9d vim-patch:6a54dcb: runtime(gdscript): add recommended indent options to ftplugin
related: vim/vim#15264

6a54dcbbd6

Co-authored-by: markmacode <code@mamo.aleeas.com>
2024-07-17 11:11:58 +02:00
Christian Clason
61ea466591 vim-patch:9.1.0592: runtime: filetype: Mediawiki files are not recognized
Problem:  filetype: Mediawiki files are not recognized
Solution: detect "*.mw" and "*.wiki" as mediawiki filetype,
          include basic syntax and filetype plugins.
          (AvidSeeker)

closes: vim/vim#15266

b5844104ab

Co-authored-by: AvidSeeker <avidseeker7@protonmail.com>
2024-07-17 11:11:58 +02:00
Christian Clason
4a7371c714 vim-patch:9.1.0591: filetype: *.wl files are not recognized
Problem:  filetype: *.wl files are not recognized
Solution: Detect '*.wl' files as Mathematica package files
          (Jonas Dujava)

closes: vim/vim#15269

c6d7dc0393

Co-authored-by: Jonas Dujava <jonas.dujava@gmail.com>
2024-07-17 11:11:58 +02:00
Riley Bruins
1f2f460b4a
fix(lsp): don't show codelens for buffers that don't support it (#29690) 2024-07-16 19:48:54 +02:00
Maria José Solano
5fe4ce6678
fix(snippet): modify base indentation when there's actually whitespace (#29670) 2024-07-16 19:30:22 +02:00
altermo
118ae7e5ed fix(tohtml): support ranges again 2024-07-16 15:07:40 +02:00
Christian Clason
a0fd51c1e2 vim-patch:1cc4cae: runtime(typst): Add typst runtime files
closes: vim/vim#15234

1cc4cae961

Co-authored-by: Gregory Anders <greg@gpanders.com>
2024-07-16 09:43:57 +02:00
altermo
25db0a1385 fix(tohtml): extmark text may be out of bounds 2024-07-16 08:11:26 +01:00
zeertzjq
c2b51e6c41
vim-patch:df62c62: runtime(doc): grammar fixes in options.txt (#29729)
closes: vim/vim#15265

df62c62177

Co-authored-by: Dominique Pellé <dominique.pelle@gmail.com>
2024-07-15 22:24:02 +00:00
Maria José Solano
8703e7bd12 docs(lpeg): merge upstream changes 2024-07-15 21:16:29 +01:00
dundargoc
04c158fbec
docs: misc (#29622)
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-07-15 06:54:45 +08:00
Christian Clason
79130c0fd3 vim-patch:9.1.0586: ocaml runtime files are outdated
Problem:  ocaml runtime files are outdated
Solution: sync those files with the upstream repo,
          detect a few more ocaml files
          (Yinzuo Jiang)

closes: vim/vim#15260

700cf8cfa1

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-07-14 23:55:57 +02:00
Christian Clason
60734dc761 vim-patch:9.1.0583: filetype: *.pdf_tex files are not recognized
Problem:  filetype: *.pdf_tex files are not recognized
Solution: Detect '*.pdf_tex' files as tex filetype
          (Jonas Dujava)

Those files are generated by inkscape, when exporting, see e.g.
https://inkscape.org/doc/inkscape-man.html

closes: vim/vim#15250

28145e005d

Co-authored-by: Jonas Dujava <jonas.dujava@gmail.com>
2024-07-14 12:21:11 +02:00
zeertzjq
8b7c8a0994
vim-patch:27c5598: runtime(doc): Add hint how to load termdebug from vimrc (#29704)
fixes: vim/vim#15256

27c55984de

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-14 18:15:50 +08:00
zeertzjq
ba36742211 vim-patch:9.1.0574: ex: wrong handling of commands after bar
Problem:  ex: wrong handling of commands after bar
Solution: for :append, :insert and :change use the text after the bar
          as input for those commands. This is what POSIX requests.
          (Mohamed Akram)

See the POSIX Spec:
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ex.html#tag_20_40_13_03
Section 12.c

closes: vim/vim#15229

8c446da349

Co-authored-by: Mohamed Akram <mohd.akram@outlook.com>
2024-07-14 13:39:40 +08:00
zeertzjq
9093fbdd02 vim-patch:9.1.0573: ex: no implicit print for single addresses
Problem:  ex: no implicit print for single addresses
Solution: explicitly print even during single addresses,
          as requested by POSIX (Mohamed Akram)

See the POSIX behaviour here:
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ex.html#tag_20_40_13_03
Section 6b

closes: vim/vim#15230

c25a7084e9

Co-authored-by: Mohamed Akram <mohd.akram@outlook.com>
2024-07-14 13:39:40 +08:00
bfredl
2ad8428637
Merge pull request #29659 from amitds1997/fix/empty-dict-encoding
fix(lua)!: do not use typed table for empty dict
2024-07-13 14:55:35 +02:00
Amit Singh
970a27927e
fix(lua)!: do not use typed table for empty dict
Problem:
Empty dictionaries are converted into typed tables of the form `{ [true]
= 6}` instead of an empty dictionary representation `{}`. This leads to
incorrect table representation, along with failure in JSON encoding of
such tables as currently tables with only string and number type keys
can be encoded.

Solution:
The typed table logic has been removed from `nlua_push_Dictionary`. The
typed table logic is required only for float value conversions which is
already handled in `nlua_push_Float`. So, it is(was) no longer required
here.

Fixes neovim/neovim#29218
2024-07-13 16:42:28 +05:30
Lewis Russell
b0f39f3ef5
Merge pull request #29632 from echasnovski/filetype-refactor
refactor(filetype): extract some functions, use more cache
2024-07-13 08:27:47 +01:00
zeertzjq
b1aa8f5eb8
vim-patch:9.1.0572: cannot specify tab page closing behaviour (#29682)
Problem:  cannot specify tab page closing behaviour
          (Gianluca Pacchiella)
Solution: Add the 'tabclose' option (LemonBoy).

fixes: vim/vim#5967
closes: vim/vim#15204

5247b0b92e

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-07-13 08:56:58 +08:00
zeertzjq
10256bb760
vim-patch:74703f1: runtime(doc): remove obsolete Ex insert behavior (#29678)
related: vim/vim#15120
closes: vim/vim#15228

74703f1086

Nvim only supports Vim Ex mode, so this is long obsolete in Nvim.

Co-authored-by: Mohamed Akram <mohd.akram@outlook.com>
2024-07-13 04:38:37 +08:00
Evgeni Chasnovski
708b5f86ba
refactor(filetype): use Lua patterns without implicit anchoring 2024-07-12 21:16:09 +03:00
Evgeni Chasnovski
9d14b76089
refactor(filetype): extract expanding env. vars in separate function 2024-07-12 21:16:09 +03:00
Evgeni Chasnovski
abf4b65a51
perf(filetype): cache (more) pattern data during "add" time 2024-07-12 21:16:09 +03:00
Evgeni Chasnovski
c7e8fc6302
refactor(filetype): unify matching patterns with pos/neg priority
Problem: due to single list of sorted patterns, their matching inside
  `vim.filetype.match()` was done very similarly but with extra checks
  to stop processing negative priority patterns before extensions.

Solution: create separated sorted lists for patterns with non-negative
  and negative priorities. This allows to process them in a single
  extracted function making the main codeflow a bit nicer and more
  easily expandable.
2024-07-12 21:16:09 +03:00
Christian Clason
8d8b8af2d2 vim-patch:57f7d75: runtime(logindefs): update syntax with new keywords
* add keywords
* enforce octal format for permissions

closes: vim/vim#15222

57f7d75591

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2024-07-12 11:41:51 +02:00
Christian Clason
26d5253805 vim-patch:fc533c9: runtime(mojo): include mojo ftplugin and indent script
Taken from excerpts of the Python ftplugin and adapted,
indent script simply sources the python indent script.

closes: vim/vim#15171

fc533c9f06

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-12 11:34:11 +02:00
Christian Clason
f4beab7ad8 vim-patch:7a22cb8: runtime(fstab): Add missing keywords to fstab syntax
Added overlay, tracefs and fixed the "none" keyword in the fstab syntax definition.

closes: vim/vim#15217

7a22cb8141

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-12 11:34:00 +02:00
zeertzjq
83f42aa450 vim-patch:9.1.0568: Cannot expand paths from 'cdpath' setting
Problem:  Cannot expand paths from 'cdpath' setting
          (Daniel Hahler)
Solution: Implement 'cdpath' completion, add the new 'dir_in_path'
          completion type (LemonBoy)

fixes vim/vim#374
closes: vim/vim#15205

a20bf69a3b

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-07-12 07:39:36 +08:00
zeertzjq
45b7a2c503
vim-patch:9.1.0557: moving in the buffer list doesn't work as documented (#29653)
Problem:  moving in the buffer list doesn't work as documented
          (SenileFelineS)
Solution: Skip non-help buffers, when run from normal buffers, else
          only move from help buffers to the next help buffer (LemonBoy)

As explained in the help section for :bnext and :bprev the commands
should jump from help buffers to help buffers (and from regular ones to
regular ones).

fixes: vim/vim#4478
closes: vim/vim#15198

893eeeb445

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-07-11 08:02:59 +08:00
Christian Clason
afbe7736a4 vim-patch:9.1.0555: filetype: angular ft detection is still problematic
Problem:  filetype: angular ft detection is still problematic
          (after 9.1.0551)
Solution: detect htmlangular filetype only by inspecting the content,
          do not try to determine it from a generic name like
          '*.component.html'

For the reasons mentioned here:

https://github.com/vim/vim/pull/13594#issuecomment-1834465890

related: vim/vim#15190
related: vim/vim#13594
related: vim/vim#13604

c03f631b7b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-11 00:41:40 +02:00
Christian Clason
f24dd5481b vim-patch:a3a14d5: runtime(htmlangular): correct comment
related: vim/vim#15190

a3a14d5469

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-11 00:41:40 +02:00
zeertzjq
15f6cf0c8f
vim-patch:7a85e34: runtime(doc): fix inconsistencies in :h file-searching (#29652)
closes: vim/vim#15201

7a85e343d2
2024-07-11 06:27:40 +08:00
Christian Clason
17bc5af01b vim-patch:9.1.0553: filetype: *.mcmeta files are not recognized
Problem:  filetype: *.mcmeta files are not recognized
Solution: Detect '*.mcmeta' files as json filetype
          (Tomodachi94)

"pack.mcmeta" was added to the JSON tests because that is the most common
filename with that extension.

There are currently 34,000 instances of this file extension on GitHub:
https://github.com/search?q=path%3A*.mcmeta&type=code&p=2

.zip files with this extension have downloads in the millions on sites
like CurseForge:
https://www.curseforge.com/minecraft/search?page=1&pageSize=20&sortBy=relevancy&class=texture-packs

Further reading about the file extension:
https://minecraft.wiki/w/Tutorials/Creating_a_resource_pack#Creating_a_.MCMETA_file

closes: vim/vim#15189

d33a518025

Co-authored-by: Tomodachi94 <tomodachi94@protonmail.com>
2024-07-10 09:31:48 +02:00
Christian Clason
7fa089f463 vim-patch:9.1.0551: filetype: htmlangular files are not properly detected
Problem:  filetype: htmlangular files are not properly detected
Solution: Use the new htmlangular filetype for angular files, because
          since angular v17, those are no longer valid HTML files.
          (Dennis van den Berg)

Since Angular 17, the new Control Flow Syntax is not valid HTML. This PR
adds a new filetype detection for the HTML templates of Angular.

It first checks the filename. The Angular convention is to use
*.component.html for the template. However, this is not mandatory.

If the filename does not match, it will check the contents of the file
if it contains:

  - One of the Control-Flow blocks: @if, @for, @switch, @defer
  - A structural directive: *ngIf, *ngFor, *ngSwitch, *ngTemplateOutlet
  - Builtin Angular elements: ng-template or ng-content
  - String interpolation: {{ something }}

This enables the Angular LSP to attach only to htmlangular filetypes, as
well as language parsers, such as tree-sitter.

closes: vim/vim#15190

1ad194c0df

Co-authored-by: Dennis van den Berg <dennis.vandenberg@nedap.com>
2024-07-10 09:31:48 +02:00
Christian Clason
136c11ca22 vim-patch:9.1.0550: filetype: antlr4 files are not recognized
Problem:  filetype: antlr4 files are not recognized
Solution: Detect '*.g4' as antlr4 filetype, include a simple antlr4
          syntax and filetype plugin (Yinzuo Jiang)

closes: vim/vim#15191

4a7a4a3675

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-07-10 09:31:48 +02:00
zeertzjq
158ffd646d
vim-patch:9.1.0554: :bw leaves jumplist and tagstack data around (#29639)
Problem:  :bw leaves jumplist and tagstack data around
          (Paul "Joey" Clark)
Solution: Wipe jumplist and tagstack references to the wiped buffer
          (LemonBoy)

As documented the :bwipeout command brutally deletes all the references
to the buffer, so let's make it delete all the entries in the jump list
and tag stack referring to the wiped-out buffer.

fixes: vim/vim#8201
closes: vim/vim#15185

4ff3a9b1e3

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-07-10 10:35:12 +08:00
zeertzjq
545aafbeb8
vim-patch:9.1.0547: No way to get the arity of a Vim function (#29638)
Problem:  No way to get the arity of a Vim function
          (Austin Ziegler)
Solution: Enhance get() Vim script function to return the function
          argument info using get(func, "arity") (LemonBoy)

fixes: vim/vim#15097
closes: vim/vim#15109

48b7d05a4f

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-07-10 08:07:16 +08:00
Christian Clason
f3c7fb9db1 vim-patch:73a8108: runtime(tmux): Update syntax script
closes: vim/vim#15195
related: vim/vim#15188

73a810817b

Co-authored-by: Eric Pruitt <eric.pruitt@gmail.com>
Co-authored-by: Contsantine Bulany <61948252+lostl1ght@users.noreply.github.com>
2024-07-09 22:05:45 +02:00
Max Coplan
d918ebe3b8
fix(diagnostic): fix backwards compatibility for goto_next and goto_prev (#29593) 2024-07-09 14:08:12 -05:00
Christian Clason
51d85f7ea5
build(deps): drop unused bundled bash, python parsers and queries
Problem: Neovim bundles treesitter parsers for bash and python but does
not use them by default. This dilutes the messaging about the bundled
parsers being required for functionality or reasonable out-of-the-box
experience. It also increases the risk of query incompatibilities for no
gain.

Solution: Stop bundling bash and python parser and queries.
2024-07-09 15:26:48 +02:00
zeertzjq
487f44a6c1
fix(lua): change some vim.fn.expand() to vim.fs.normalize() (#29583)
Unlike vim.fn.expand(), vim.fs.normalize() doesn't expand wildcards.
2024-07-09 19:17:50 +08:00
zeertzjq
fb6c059dc5
vim-patch:d1c3698: runtime(doc): fix typo in :h ft-csv-syntax (#29619)
closes: vim/vim#15179

d1c369892d
2024-07-09 06:41:26 +08:00
Christian Clason
9ebf3454ad vim-patch:ab03dd2: runtime(hlsplaylist): include hlsplaylist ftplugin file
fixes: vim/vim#15156
closes: vim/vim#15162

ab03dd2085

Co-authored-by: AvidSeeker <avidseeker7@protonmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-07-09 00:34:34 +02:00
Evgeni Chasnovski
dc04ef2a20
perf(filetype): skip contents check in match() if there is no contents (#29596)
Problem: `vim.filetype.match()` tries to match on contents even if there
  is no contents (empty buffer or `{''}` explicit contents).
  This results in extra avoidable execution duration for cases.
  It matters, for example, when trying to match filetype based solely
  on file name (which still needs `contents` or `buf` to properly match
  earlier in the code path).

Solution: skip matching based solely on contents if it is `{''}`. This
  works because:
    - Matching solely on content is done after any user-configured
      `vim.filetype.add()` hooks.
    - All default matching on content might depend on supplied path
      *only* if there is non-empty content (like in
      `require('vim.filetype.detect').match_from_hashbang()`).
2024-07-08 11:20:32 -05:00
Christian Clason
b3d94b1087 vim-patch:f77a0e9: runtime(cmakecache): include cmakecache ftplugin file
closes: vim/vim#15175

f77a0e9f41

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-08 12:14:44 +02:00
Christian Clason
3b4481d3a5 vim-patch:380f980: runtime(lex): include lex ftplugin file
Spec found [here](https://docs.oracle.com/cd/E19504-01/802-5880/lex-6/index.html)

closes: vim/vim#15174

380f98002d

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-08 12:14:44 +02:00
Christian Clason
f7274fde06 vim-patch:7d60dc2: runtime(yacc): include yacc ftplugin file
closes: vim/vim#15173

7d60dc2069

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-08 12:14:44 +02:00
Christian Clason
e271110e37 vim-patch:08b0c12: runtime(squirrel): include squirrel ftplugin file
Comment spec found [here](https://squirrel-lang.org/squirreldoc/reference/language/lexical_structure.html#comments)

closes: vim/vim#15172

08b0c12716

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-08 12:14:44 +02:00
Christian Clason
79c63b5561 vim-patch:2c9ef3a: runtime(objcpp): include objcpp ftplugin file
This one just sources the objc.vim ftplugin.

closes: vim/vim#15170

2c9ef3a671

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-08 12:14:44 +02:00
Christian Clason
8aab46da5e vim-patch:94c1c66: runtime(tf): include tf ftplugin file
Adds ftplugin support for tf (TinyFugue). Comment support taken from
[here](1e8ac0bb01/src/command.c (L568))

closes: vim/vim#15168

94c1c6638a

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-08 12:14:44 +02:00
Christian Clason
97704a6694 vim-patch:01e2090: runtime(mysql): include mysql ftplugin file
This one just sources from the SQL ftplugin. Without this, *.mysql
files don't inherit the common SQL settings.

closes: vim/vim#15166

01e20902f4

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-08 12:14:44 +02:00
Christian Clason
d70c224131 vim-patch:a264bb9: runtime(javacc): include javacc ftplugin file
closes: vim/vim#15167

a264bb931e

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-08 12:14:44 +02:00
Christian Clason
bc3051e7a7 vim-patch:2525608: runtime(cabal): include cabal ftplugin file
closes: vim/vim#15158

2525608d73

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-08 12:14:44 +02:00
Christian Clason
60b74f27d0 vim-patch:f5398c8: runtime(cuda): include CUDA ftplugin file
closes: vim/vim#15159

f5398c8975

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-08 12:14:44 +02:00
Christian Clason
4315657a36 vim-patch:2c299eb: runtime(editorconfig): include editorconfig ftplugin file
closes: vim/vim#15160

2c299eb258

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-08 12:14:44 +02:00
Christian Clason
27cd2aa38d vim-patch:8906e22: runtime(kivy): update kivy syntax, include ftplugin
Kivy uses "#:" for preprocessing commands (like "#:import ...") which
were overridden by the comment syntax. This has been changed, and a
commentstring has been added.

closes: vim/vim#15163

8906e22df5

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-08 12:14:44 +02:00
Jaehwang Jung
8474f52978 fix(treesitter.foldexpr): robustness against ctrl-c
Problem:
Exiting the insert mode with ctrl-c does not trigger InsertLeave
autocmd. This may lead to nil error in treesitter foldexpr.

Solution:
Check nil. Folds still can be stale after exiting the insert mode with
ctrl-c, but it will be eventually updated correctly.

An alternative solution would be to ensure that exiting the insert mode
always triggers do_foldupdate. This can be done either by "fixing"
ctrl-c or with on_key callback that checks ctrl-c (nvim-cmp does this).
2024-07-08 11:06:26 +01:00
Christian Clason
bf92d423a9 vim-patch:9.1.0544: filetype: ldapconf files are not recognized
Problem:  filetype: ldapconf files are not recognized
Solution: Detect '.ldaprc', 'ldap.conf' and 'ldaprc' files as ldapconf
          filetype, include a simple ldapconf ftplugin file
          (Riley Bruins)

[Specification](https://www.openldap.org/software//man.cgi?query=ldap.conf&sektion=5&apropos=0&manpath=OpenLDAP+2.4-Release)

closes: vim/vim#15176

62f31e9499

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-08 11:03:51 +02:00
zeertzjq
76b91106fc
vim-patch:9.1.0543: Behavior of CursorMovedC is strange (#29608)
Problem:  Behavior of CursorMovedC is strange.
Solution: Also trigger when the cmdline has changed.
          (zeertzjq)

fixes: vim/vim#15069
closes: vim/vim#15071

8145620a95
2024-07-08 06:55:21 +08:00
zeertzjq
055a222797
vim-patch:e85fdc7: runtime(vim): Update base-syntax, improve :match command highlighting (#29607)
Match group and pattern arguments to :match commands.

closes: vim/vim#15096

e85fdc730e

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-07-08 06:51:23 +08:00
zeertzjq
435ce99213 vim-patch:9.1.0540: Unused assignment in sign_define_cmd()
Problem:  Unused assignment in sign_define_cmd()
Solution: Remove the assignment.  Also document the "priority" flag of
          sign_define(). (zeertzjq)

closes: vim/vim#15169

fc3f5dba52
2024-07-08 06:20:22 +08:00
zeertzjq
7b5364166c vim-patch:fbbabbc: runtime(doc): add page-scrolling keys to index.txt
Also add the newly documented keys from commit 6a4afb1efca1bac5fbc0281804591cf0a52b2d81
to index.txt which was forgotten.

related: vim/vim#15107

fbbabbca33

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-08 06:19:05 +08:00
zeertzjq
7195d331af vim-patch:b9bbf1f: runtime(doc): clarify how to re-init csv syntax file
fixes: vim/vim#15161

b9bbf1f044

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-08 06:17:51 +08:00
Stanislav Asunkin
5b778a64ec
fix(health): fix fetching url with python in provider health (#29594) 2024-07-07 16:37:39 +08:00
zeertzjq
6a886a2511
vim-patch:9.1.0538: not possible to assign priority when defining a sign (#29592)
Problem:  not possible to assign priority when defining a sign
          (Mathias Fußenegger)
Solution: Add the priority argument for the :sign-define ex command and
          the sign_define() function (LemonBoy)

Use the specified value instead of the default one (SIGN_DEF_PRIO) when
no priority is explicitly specified in sign_place or :sign place.

fixes: vim/vim#8334
closes: vim/vim#15124

b975ddfdf9

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-07-07 07:21:14 +08:00
Christian Clason
472b5b9b20 vim-patch:9.1.0536: filetype: zone files are not recognized
Problem:  filetype: zone files are not recognized
          (rpdprd)
Solution: Detect '*.zone' files as bindzone filetype

fixes: vim/vim#14222

f095539b39

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-07 00:36:40 +02:00
zeertzjq
5da9b49b19
vim-patch:9.1.0537: signed number detection for CTRL-X/A can be improved (#29590)
Problem:  signed number detection for CTRL-X/A can be improved
          (Chris Patuzzo)
Solution: Add the new "blank" value for the 'nrformat' setting. This
          will make Vim assume a signed number only if there is a blank
          in front of the sign.
          (distobs)

fixes: vim/vim#15033
closes: vim/vim#15110

25ac6d67d9

Co-authored-by: distobs <cuppotatocake@gmail.com>
2024-07-07 06:32:54 +08:00
zeertzjq
34fa54355a
Merge pull request #29584 from zeertzjq/vim-6a4afb1efca1
vim-patch:6a4afb1,aaaa21b
2024-07-06 17:52:28 +08:00
Andreas Schneider
55e4301036
feat(lsp): drop fswatch, use inotifywait (#29374)
This patch replaces fswatch with inotifywait from inotify-toools:

https://github.com/inotify-tools/inotify-tools

fswatch takes ~1min to set up recursively for the Samba source code
directory. inotifywait needs less than a second to do the same thing.

https://github.com/emcrisostomo/fswatch/issues/321

Also it fswatch seems to be unmaintained in the meantime.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2024-07-06 11:44:19 +02:00
Gregory Anders
91e5dcae3d
docs(lsp): add examples to lsp-quickstart for completion and autoformatting (#29497)
Auto-completion and auto-formatting are common (though certainly not
universal) features that many users want. We can document how to
accomplish this in lsp-quickstart so that users that do want these
features can easily find examples of how to configure them.
2024-07-06 11:41:55 +02:00
Zoltán Nyikos
b109b1abce
fix(glob): avoid subcapture nesting too deep error (#29520)
Use Cmt to evaluate Cond and Elem during match to avoid building the
nested capture structure later.
2024-07-06 11:40:08 +02:00
zeertzjq
285543b6aa vim-patch:aaaa21b: runtime(doc): Remove wrong help tag CTRL-SHIFT-CR
aaaa21b58f

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-06 17:32:38 +08:00
zeertzjq
9a63ab5e3b vim-patch:6a4afb1: runtime(doc): document further keys that scroll page up/down
fixes: vim/vim#15107

6a4afb1efc

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-06 17:32:22 +08:00
Christian Clason
0abaccb2a7 vim-patch:9.1.0532: filetype: Cedar files not recognized
Problem:  filetype: Cedar files not recognized
Solution: Detect '*.cedar' files as cedar filetype
          (Riley Bruins)

References: https://github.com/cedar-policy

closes: vim/vim#15148

15addb24dd

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-06 11:05:19 +02:00
Riley Bruins
9217e0d671 fix(treesitter): display fields for anonymous nodes in :InspectTree 2024-07-05 10:11:48 +02:00
dundargoc
25c59d08c4
docs: misc (#29410)
Co-authored-by: Michael Härtl <haertl.mike@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-07-05 05:20:45 +08:00
Christian Clason
71c50edceb vim-patch:3146d63: runtime(netrw): fix remaining case of register clobber
complements 62f7b55c1a4564f8744af9446bc7af47fe16a245

closes: vim/vim#15114

3146d63267

Co-authored-by: Enno <Konfekt@users.noreply.github.com>
2024-07-04 23:01:35 +02:00
Christian Clason
c49bcde927 vim-patch:11d5992: runtime(rust): use shiftwidth() in indent script
closes: vim/vim#15138

11d5992573

Co-authored-by: novenary <novenary@kwak.zip>
2024-07-04 23:01:35 +02:00
Peter Aronoff
4b3be56a03
fix(diagnostic): make docs agree with code (#29561)
Problem: the code and docs for vim.diagnostic.JumpOpts.float send mixed
signals about what the default should be. When the option is first set,
in the global_diagnostic_options table, the comment clearly says that
the default is false. Later in the code, in goto_diagnostic, there's
a line that sets the default to true if no default is present. Finally,
the docs say that the default is true.

Solution: Change the docs to reflect the new default of false and fix
the goto_diagnostic function.
2024-07-04 12:15:35 -05:00
Christian Clason
8a338c0ccc vim-patch:2fbcc15: runtime(terraform): Add filetype plugin for terraform
- Adds commentstring property for terraform
- Adds comments property for terraform

closes: vim/vim#15144

2fbcc15cf9

Co-authored-by: Janno Tjarks <janno.tjarks@mailbox.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-07-04 14:06:41 +02:00
Christian Clason
0803ac7b08 vim-patch:3d2a996: runtime(dockerfile): enable spellchecking of comments in syntax script
closes: vim/vim#15147

3d2a996267

Co-authored-by: Kafva <36083692+Kafva@users.noreply.github.com>
2024-07-04 14:06:41 +02:00
Christian Clason
7f8cd91ac0 vim-patch:2606e77: runtime(doc): rename variable for pandoc markdown support
fixes: vim/vim#15141

2606e7718c

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-04 11:54:02 +02:00
Tyler Miller
7f33c1967b
fix(lua): use rawget() to get __call in vim.is_callable() (#29536)
Lua 5.1 uses a "raw get" to retrieve `__call` from a metatable to
determine if a table is callable. Mirror this behavior in
`vim.is_callable()`.
2024-07-04 06:36:00 +08:00
zeertzjq
12c9791e0f
fix(runtime): stop treesitter highlight in b:undo_ftplugin (#29533)
It seems that nvim-treesitter stops treesitter highlight when changing
filetype, so it makes sense for builtin ftplugins to do this as well.

Use :call and v:lua here to allow separation with '|'.
2024-07-03 15:24:12 +08:00
zeertzjq
d413038b4f
fix(treesitter): ensure syntaxset augroup exists (#29542)
Problem:
Error when calling vim.treesitter.start() and vim.treesitter.stop() in
init.lua.

Solution:
Ensure syntaxset augroup exists after loading synload.vim.
2024-07-03 07:40:42 +08:00
Sebastian Lyng Johansen
aec7f1979a
fix(lsp): fallback to label for completion items if all others are missing (#29522) 2024-07-02 18:27:51 +02:00
alex-tdrn
cb84cd5d9f feat(win32): embed executable icon
Problem: on windows, the neovim executable (and thus the filetypes
associated to open with neovim) has no embedded icon

Solution: create a windows resource file pointing to the icon, and
add it to the nvim binary target
2024-07-02 13:05:16 +02:00
zeertzjq
8f5e908110
fix(runtime): update b:undo_ftplugin in Lua runtime files (#29529)
Related to #29506, but adding vim.treesitter.stop() to b:undo_ftplugin
doesn't solve the problem yet.
2024-07-01 17:48:09 +08:00
zeertzjq
e7020306a1
feat(jumplist): allow opting out of removing unloaded buffers (#29347)
Problem:  Cannot opt out of removing unloaded buffers from the jumplist.
Solution: Only enable that with "unload" flag in 'jumpoptions'.
2024-06-30 06:40:31 +08:00
dundargoc
aa6b9c677d refactor: use vim._with where possible
This mostly means replacing `nvim_buf_call` and `nvim_win_call` with
`vim._with`.
2024-06-28 19:58:31 +02:00
bfredl
46187117c9
Merge pull request #29483 from bfredl/nonbinary
refactor(typval)!: remove binary distinction of binary and nonbinary strings
2024-06-27 18:45:18 +02:00
Mathias Fußenegger
724d1110b1
fix(lsp): pre-filter matches on label if filterText is missing (#29491)
Although the built-in pum completion mechanism will filter anyway on the
next input it is odd if the initial popup shows entries which don't
match the current prefix.

Using fuzzy match on the label/prefix is compatible with
`completeopt+=fuzzy` and also doesn't seem to break postfix snippet
cases

Closes https://github.com/neovim/neovim/issues/29287
2024-06-27 12:20:00 +02:00
bfredl
bda63d5b97 refactor(typval)!: remove distinction of binary and nonbinary strings
This is a breaking change which will make refactor of typval and shada
code a lot easier. In particular, code that would use or check for
v:msgpack_types.binary in the wild would be broken. This appears to be
rarely used in existing plugins.

Also some cases where v:msgpack_type.string would be used to represent a
binary string of "string" type, we use a BLOB instead, which is
vimscripts native type for binary blobs, and already was used for BIN
formats when necessary.

msgpackdump(msgpackparse(data)) no longer preserves the distinction
of BIN and STR strings. This is very common behavior for
language-specific msgpack bindings. Nvim uses msgpack as a tool to
serialize its data. Nvim is not a tool to bit-perfectly manipulate
arbitrary msgpack data out in the wild.

The changed tests should indicate how behavior changes in various edge
cases.
2024-06-27 11:04:04 +02:00
Matt Fellenz
fc9b70826e
fix(lsp): avoid vim.keymap.del error when stopping a client (#29478) 2024-06-26 17:03:46 +02:00
dundargoc
76dd07e572
Merge pull request #29280 from echasnovski/with-owobogo
Add several updates to `vim._with` (tests, granular option contexts, `env` context)
2024-06-26 12:23:34 +02:00
zeertzjq
295e223a28
vim-patch:62f7b55: runtime(netrw): save and restore register 0-9, a and unnamed (#29479)
fixes: vim/vim#15077

62f7b55c1a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-25 09:38:50 +08:00
zeertzjq
1922f7e32b
vim-patch:ecd642a: runtime(doc): clarify, that register 1-9 will always be shifted (#29476)
related: vim/vim#15077

ecd642af43

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-25 06:18:57 +08:00
Evgeni Chasnovski
cd53db2157
feat(lua): add context.env (environment variables) to vim._with() 2024-06-24 20:23:11 +03:00
Evgeni Chasnovski
07cc559cdf
feat(lua): update vim._with to allow more granular option contexts
Problem: with a single `context.options` there is no way for user to
  force which scope (local, global, both) is being temporarily set and
  later restored.

Solution: replace single `options` context with `bo`, `go`, `wo`, and
  `o`. Naming and implementation follows how options can be set directly
  with `vim.*` (like `vim.bo`, etc.).
  Options are set for possible target `win` or `buf` context.
2024-06-24 20:23:11 +03:00
Evgeni Chasnovski
f8795365de
test(lua): cover vim._with() with tests
Problem: `vim._with()` has many different use cases which are not
  covered with tests.

Solution: cover with tests. Some (many) test cases are intentionally
  marked as "pending" because they cover cases which don't work as
  expected at the moment (and fixing them requires specific knowledge of
  C codebase). Use them as a reference for future fixes.
  Also some of "can be nested" tests currently might pass only because
  the tested context doesn't work.
2024-06-24 20:23:11 +03:00
Tom Praschan
5581a95534
feat(lsp): vim.lsp.buf.format() supports textDocument/rangesFormatting #27323
While this relies on a proposed LSP 3.18 feature, it's fully backwards
compatible, so IMO there's no harm in adding this already.

Looks like some servers already support for this e.g.
- gopls: https://go-review.googlesource.com/c/tools/+/510235
- clangd: https://github.com/llvm/llvm-project/pull/80180

Fixes #27293
2024-06-24 07:54:56 -07:00
zeertzjq
b0e5990907
refactor(filetype): change some patterns to extensions (#29472)
Ref #29468
2024-06-24 22:12:15 +08:00
Riley Bruins
c57a85e0ed perf(treesitter): remove unnecessary foldexpr loop
Instead of looping over all captured nodes, just take the end range from
the last node in the list. This uses the fact that nodes returned by
iter_matches are ordered by their range (earlier to later).
2024-06-24 14:10:25 +02:00
Luuk van Baal
da4e8dc5b0 fix(treesitter): do not modify highlight state for _on_spell_nav
Problem:  Treesitter highlighter clears the already populated highlight
          state when performing spell checking while drawing a
          smoothscrolled topline.
Solution: Save and restore the highlight state in the highlighter's
          _on_spell_nav callback.
2024-06-24 09:22:27 +01:00
Christian Clason
be999e6a0e vim-patch:01a4fb1: runtime(java): Compose "g:java_highlight_signature" and "g:java_highlight_functions"
With the variables defined, distinctly highlight parts of
a method declaration header: its name and parameter list
parens, from its type parameters, return type, and formal
parameters; and distinctly highlight parts of a lambda
expression: its parameter list parens and the arrow, from
its formal parameters and identifiers.

closes: vim/vim#15083

01a4fb104d

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-06-23 12:20:08 +02:00
zeertzjq
5a8a34dafa
fix(filetype): source ftdetect/* after creating scripts.vim autocmds (#29445) 2024-06-22 21:17:36 +08:00
zeertzjq
6796f7cf61
vim-patch:fc64ac0: runtime(vim): Update base-syntax, fix function tail comments (#29450)
Match Vim9-script comments after :def and :enddef and legacy-script
comments after :func and :endfunc, in any definition context.

Highlight incorrect comment types after these commands as errors.

fixes: vim/vim#15062
closes: vim/vim#15072

fc64ac0be2

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-06-22 19:46:13 +08:00
Christian Clason
d82efeccc7 vim-patch:9.1.0506: filetype: .envrc & .prettierignore not recognized
Problem:  filetype: .envrc & .prettierignore not recognized
Solution: Detect '.envrc' as shell and '.prettierignore' as gitignore
          filetype (Tyler Miller)

Support ft detection for `.envrc` files used by direnv, and
`.prettierignore` files used by prettier.

closes: vim/vim#15053
resolves: neovim/neovim#29405

49012cd8c2

Co-authored-by: Tyler Miller <tmillr@proton.me>
2024-06-21 11:17:33 +02:00
Christian Clason
5eb604c642 vim-patch:17e0a19: runtime(scheme): update runtime files
Add TODO highlighting, disable text-wrapping, add "define-library" to
lispwords on CHICKEN. Update MAINTAINERS.

closes: vim/vim#15063

17e0a1969d

Co-authored-by: Evan Hanson <evhan@foldling.org>
2024-06-21 11:03:47 +02:00
Christian Clason
7306adaebc vim-patch:beb02ed: runtime(java): Optionally highlight parameterised types
In the presence of parameterised types whose names begin
with a capital letter and end with a less-than sign "<" that
introduces a type argument or a list of comma-separated type
arguments, followed by a greater-than sign ">", a variable
"g:java_highlight_generics" can be defined to have some
components of such types uniformly coloured (by picking
highlight groups for javaGenericsC{1,2}, javaWildcardBound).

For example,
------------------------------------------------------------
java.io.InputStream stream = java.io.InputStream.nullInputStream();
java.util.function.Function<String,
    java.util.function.BiFunction<String, String, String>> updater =
	property -> (oldValue, newValue) -> oldValue;
java.util.logging.LogManager.getLogManager()
    .updateConfiguration(stream, updater);
------------------------------------------------------------

Note that the diamond form and explicit type arguments do
not qualify for this kind of recognition.

For example,
------------------------------------------------------------
new java.util.HashSet<>().<String>toArray(new String[0]);
------------------------------------------------------------

References:
https://docs.oracle.com/javase/specs/jls/se21/html/jls-4.html#jls-4.5
https://docs.oracle.com/javase/specs/jls/se21/html/jls-15.html#jls-15.9
https://docs.oracle.com/javase/specs/jls/se21/html/jls-15.html#jls-15.12.2.1

closes: vim/vim#15050

beb02ed674

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-06-21 11:03:47 +02:00
zeertzjq
f45403db19 vim-patch:9.1.0511: CursorMovedC triggered wrongly with setcmdpos()
Problem:  CursorMovedC triggered wrongly with setcmdpos()
          (after v9.1.0507)
Solution: Remove the premature triggering.  Also don't trigger when
          cursor didn't move. (zeertzjq)

closes: vim/vim#15064

bc6f96708e
2024-06-21 14:13:33 +08:00
zeertzjq
86ea42ce26 vim-patch:9.1.0507: hard to detect cursor movement in the command line
Problem:  hard to detect cursor movement in the command line
Solution: Add the CursorMovedC autocommand
          (Shougo Matsushita)

closes: vim/vim#15040

d09521476f

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2024-06-21 14:10:30 +08:00
yuyk
26c2a56d99
vim-patch:6ccf6da: runtime(gomod): add gomod filetype plugin (#29433)
closes: vim/vim#15060

6ccf6da7a2
2024-06-21 12:36:57 +08:00
Jaehwang Jung
0e3e1e6b6d
fix(treesitter): don't open fold when o/O adds a line below #28709
Problem:
`o`-ing on a folded line opens the fold, because the new line gets the
fold level from the above line (level '='), which extends the fold to
the new line. `O` has a similar problem when run on the line below a
fold.

Solution:
Use -1 for the added line to get the lower level from the above/below
line.
2024-06-20 06:37:09 -07:00
zeertzjq
b923fcbaf0
build(vim-patch.sh): don't ignore changes to version*.txt (#29425)
Suggest adding them to news.txt instead.

Also don't ignore changes to intro.txt and sponsor.txt, as they don't
change much these days, and it's necessary to consider whether to
include their changes in Nvim's intro.txt.
2024-06-20 20:16:53 +08:00
zeertzjq
af0021f990
vim-patch:9.1.0505: filetype: Faust files are not recognized (#29426)
Problem:  filetype: Faust files are not recognized
Solution: Detect '*.lib' files as Faust filetype, add detection for
          '*.dsp' files (Faust or Make), remove '*.lib' from Cobol
          filetype (PowerUser64)

closes: vim/vim#14894

aa61b8a908

Co-authored-by: PowerUser64 <blake@blakenorth.net>
2024-06-20 17:45:41 +08:00
Christian Clason
ac6f0c02cf vim-patch:94c5d8a: runtime(java): Remove the group exclusion list from @javaTop
Instances of anonymous classes can be passed as method
arguments and should be subject to line folding as well.

closes: vim/vim#15048

94c5d8a5e2

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-06-20 09:28:01 +02:00
zeertzjq
978b0263f8
Merge pull request #29413 from jiangyinzuo/vim-patch-9.1.0497
vim-patch:partial:9.1.{0497,0501}: termdebug can be further improved
2024-06-20 12:29:47 +08:00
Christian Clason
38a1d41ac0 vim-patch:aeca717: runtime(nohlsearch): simplify mapping
Use <cmd> instead of <expr> with execute(...)[-1]

closes: vim/vim#15047

aeca7176f3

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-06-19 22:50:54 +02:00
Justin M. Keyes
ceea6898a8
fix(gen_help_html): handle delimiter, heading #29415
Problem:
vimdoc grammar added new forms that are not handled in our HTML
generator. https://github.com/neovim/tree-sitter-vimdoc/pull/134

Solution:
Update `gen_help_html.lua`.

Fixes #29277
2024-06-19 09:45:40 -07:00
Riley Bruins
e5e81262af
fix(diagnostics): don't apply extmarks to invalid lines #29321
Problem:
If there are errors in the last line of a buffer, something like `Gdk` or
`G2k3J` will produce an error (at least with `lua_ls`):

    Error executing vim.schedule lua callback:
    .../neovim/share/nvim/runtime/lua/vim/diagnostic.lua:1446: Invalid 'line': out of range

Solution:
Only set extmarks if the target buffer line still exists
2024-06-19 09:28:44 -07:00
Yinzuo Jiang
b48192af37 vim-patch:partial:9.1.0497: termdebug can be further improved
Problem:  termdebug can be further improved
Solution: refactor save/restore, update docs,
          add a new save/restore test (Ubaldo Tiberi)

closes: vim/vim#15032

a48637c105

Co-authored-by: Ubaldo Tiberi <ubaldo.tiberi@google.com>
2024-06-19 21:23:21 +08:00
Christian Clason
fe5d1279a4
vim-patch:1ce65e3: runtime(csv): include a simple csv filetype and syntax plugin (#29395)
* vim-patch:1ce65e3: runtime(csv): include a simple csv filetype and syntax plugin

fixes: vim/vim#15038

1ce65e35ac

Co-authored-by: Maxim Kim <habamax@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-06-19 09:41:03 +02:00
zeertzjq
14aba67967 vim-patch:8.2.4724: current instance of last search pattern not easily spotted
Problem:    Current instance of last search pattern not easily spotted.
Solution:   Add CurSearch highlighting. (closes vim/vim#10133)

a43993897a

Some code is superseded by later patches that are already ported.

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-06-19 08:02:02 +08:00
Christian Clason
6012f79557 vim-patch:9718ed7: runtime(filetype): update htmldjango detection
- update tags to detect djangohtml based on
  https://docs.djangoproject.com/en/5.0/ref/templates/builtins/#built-in-tag-reference

- increase the lines to inspect to 40 lines

  10 lines is too few and might result in high false negative.
  Increasing it to 40 lines should reduce the false negative.

closes: vim/vim#15037

9718ed7ab9

Co-authored-by: Afiq Nazrie <afnazrie@gmail.com>
2024-06-19 00:22:58 +02:00
Christian Clason
2791fd4e17 vim-patch:26de90c: runtime(nohlsearch): include the the simple nohlsearch package
fixes: vim/vim#15039
closes: vim/vim#15042

26de90c631

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-06-18 23:59:39 +02:00
zeertzjq
9d200c78a5
vim-patch:ca47114: runtime(doc): improve the vim-shebang example (#29382)
ca47114532

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-18 07:11:17 +08:00
Yi Ming
7ce261c064
docs(lsp): format the handwritten part #29295 2024-06-17 16:04:40 -07:00
zeertzjq
a46991e1c6
docs(news): fix inconsistencies (#29381) 2024-06-18 07:00:32 +08:00
zeertzjq
c429c5f86f vim-patch:9.1.0495: Matched text isn't highlighted in cmdline pum
Problem:  Matched text isn't highlighted in cmdline pum.
Solution: Use cmdline completion pattern in cmdline mode.
          (zeertzjq)

closes: vim/vim#15029

d8c9340fc6

Cherry-pick syntax.txt change from runtime update.
2024-06-18 06:18:34 +08:00
Justin M. Keyes
b60030b7bf
Merge #28775 fix(man.vim): signcolumn causes broken wrap 2024-06-17 15:09:30 -07:00
zeertzjq
7746c54e10
Merge pull request #29357 from luukvbaal/statuscol
feat(column)!: rework 'statuscolumn' %r/l items
2024-06-17 06:33:15 +08:00
Christian Clason
c3cb56d8ec vim-patch:0ddab58: runtime(java): Add a config variable for commonly used compiler options
The value of g:javac_makeprg_params, if set, is added to the value of
'makeprg' as an option string.

closes: vim/vim#14999

0ddab582fa

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-06-16 23:24:55 +02:00
Christian Clason
72ddf213a1 vim-patch:917ff8a: runtime(html): bump length of character references in syntax script (vim/vim#15022)
This allows handling longer references such as
`&CounterClockwiseContourIntegral;`.

917ff8a19d

Co-authored-by: Mohamed Akram <mohd.akram@outlook.com>
2024-06-16 23:24:55 +02:00
Luuk van Baal
ad70c9892d feat(column)!: rework 'statuscolumn' %r/l items
Problem:  A custom 'statuscolumn' needs to check a bunch of options and
          placed signs to replicate the default number column.
Solution: Rework %l item to include the necessary logic to mimic the
          default number column. Remove now redundant %r item.
2024-06-16 19:04:34 +02:00
Christian Clason
615e859a0e vim-patch:79da22d: runtime(kdl): fix KdlIndent and kdlComment in indent script (vim/vim#15019)
79da22de75

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-06-16 12:00:58 +02:00
Christian Clason
2f87d363c1 vim-patch:371bab0: runtime(java): Fold multi-line comments with the syntax kind of &fdm (vim/vim#15016)
Also:

- Restore the capability to mark as an error braces nested
  in parens with g:javaInParen.
- Try not to fold top-level-type bodies.  (Defining multiple
  package-private top level types in a single source file is
  not recommended as it can impose order among compilation
  units; so it is assumed that only one such top level type
  is usually defined.)
- Compose ‘method header’ highlighting and block braces
  folding.
- Do not highlight block braces whenever ‘method header’
  highlighting is requested.

This bundling of ‘method headers’ and block braces for
highlighting can be traced back to Vim v5.0; however, no
comment or documentation entry conveys any justification.
For example, it is hard to discover the connection between
block braces for "while", "if", etc., statements and method
body block braces.  The former behaviour can be attained in,
e.g. ~/.vim/after/syntax/java.vim:

------------------------------------------------------------
if exists("g:java_highlight_functions")
    syn clear javaBlock javaInParen
    syn match javaBlockOther "[{}]"
    syn region javaBlock transparent matchgroup=javaBlockStart
	\ start="\%(^\|^\S[^:]\+\)\@120<!{" end="}" fold
    hi def link javaBlockStart javaFuncDef
    hi def link javaBlockOther javaBlockStart

    if exists("g:java_mark_braces_in_parens_as_errors")
	syn match javaInParen contained "[{}]"
    endif
endif
------------------------------------------------------------

Note: Read ‘a method header omitting a _throws_ clause’ for
every ‘method header’ appellation used above.

371bab0594

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2024-06-16 12:00:58 +02:00
Christian Clason
191a70f9dd vim-patch:9.1.0492: filetype: Vim-script files not detected by shebang line
Problem:  Vim-script files may not be recognised
Solution: Add shebang line detection (Doug Kearns)

closes: vim/vim#15012

0d4d23dac0

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-06-16 11:45:44 +02:00
zeertzjq
7e65f3757b
docs: document 'list' behavior when 'listchars' excludes "tab" (#29360) 2024-06-16 06:08:36 +08:00
zeertzjq
c1d463fcaf vim-patch:52f2ff0: runtime(zip): revert unintended change to zip#Write()
This was wrongly included as of patch 1c6734291295bf8aa39577840b40bb
because apparently I messed up the use of git apply :/

52f2ff0363

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-16 05:52:13 +08:00
zeertzjq
6f1cbfc9ab vim-patch:1c67342: runtime(zip): MS-Windows: handle files with spaces properly
This change does the following 3 things:

1) non need to quote the file to be extracted

The zipfile plugin used to quote and fnameescape() the path to the
file to be extracted. However testing with unzip showed, that while this
works on Linux on Windows you shall not escape the blanks in filenames.

As long as the pathname is properly quoted, this words on Linux and
Windows.

2) reset shellslash (MS-Windows only)

When shellslash is set, filenames to the zip archive will be forward
quoted. However since the filename is eventually handed over to the
unzip command, we need to make sure to use native paths so that the
command will understand what file to open. Therefore, if shellslash is
set (and the shell is cmd.exe), replace any forward slashes by the
expected backslashes

3) style:
Use tabs for the Header, remove a few comments in the s:Escape() and
zip#read() functions

fixes: vim/vim#14998

1c67342912

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-16 05:51:53 +08:00
zeertzjq
c5e3321aa1
vim-patch:f4bc59c: runtime(doc): add another tag for vim-shebang feature (#29356)
related: vim/vim#15011

f4bc59c4f6

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-15 22:26:36 +08:00
zeertzjq
bb487ea12e
vim-patch:ae321b5: runtime(vim): Update base-syntax, match shebang lines (vim/vim#15011) (#29351)
Match shebang lines in Vim9 and legacy script.

Mark these as an error if they appear anywhere other than the first line
of a legacy-script file.  In Vim9 script these match as normal line
comments rather than an error.

ae321b51f7

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-06-15 21:28:23 +08:00
Christian Clason
4faad4a950 vim-patch:9.1.0486: filetype: Snakemake files are not recognized
Problem:  filetype: Snakemake files are not recognized
Solution: Detect '*.smk' and Snakefile files as snakemake filetype
          (Riley Bruins)

See:
https://snakemake.readthedocs.io/en/stable/snakefiles/deployment.html#distribution-and-reproducibility

closes: vim/vim#14992

82a579e15a

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-06-15 10:27:59 +02:00
Jerry
61aabe0730
fix(defaults): default @/Q broken when 'ignorecase' is set (#29343)
Problem:
When 'ignorecase' is set, the default keymap Q and Q would exit visual
mode.

This issue was raised in #28287 and a fix was applied in #28289.

However, `==` operator is subject to user `ignorecase` setting.

Solution:
Switching to `==#` operator would guarantee case sensitive comparison
between visual mode and linewise visual mode.

Co-authored-by: Kuanju Chen <kuanju.chen@mksinst.com>
2024-06-15 10:21:16 +08:00
dundargoc
6e28589e00
docs: misc (#29229)
Co-authored-by: Ilia Choly <ilia.choly@gmail.com>
Co-authored-by: Jose Pedro Oliveira <jose.p.oliveira.oss@gmail.com>
Co-authored-by: Maria José Solano <majosolano99@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-06-15 07:04:27 +08:00
zeertzjq
b969e3e0b9 vim-patch:c509c00: runtime(doc): fix wrong helptag for :defer
c509c009bb

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-15 06:09:11 +08:00
zeertzjq
a6e01d191a vim-patch:262e25e: runtime(vim): Update base-syntax, match :sleep arg
Match :sleep arg properly including a lone "m" with a leading count.

closes: vim/vim#15003

262e25e5a1

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-06-15 06:06:53 +08:00
zeertzjq
f557a985ef vim-patch:d6d4e13: runtime(doc): rewrite mkdir() doc and simplify {flags} meaning
related: vim/vim#14991

d6d4e13336

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-15 06:05:33 +08:00
zeertzjq
0600754d8d vim-patch:a3bddb7: runtime(vim): Update base-syntax, match :catch and :throw args (vim/vim#14989)
Match :catch /{pattern}/ and :throw {expr1}.

a3bddb759e

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-06-15 06:01:50 +08:00
Christian Clason
79ed11f257 vim-patch:79a14c0: runtime(keymap): include Georgian keymap
closes: vim/vim#15002

79a14c061b

Co-authored-by: Misho <nnamper@gmail.com>
2024-06-14 23:58:27 +02:00
zeertzjq
e2ef533025 vim-patch:9.1.0479: fuzzy_match_str_with_pos() does unnecessary list operations
Problem:  fuzzy_match_str_with_pos() does unnecessary list operations.
Solution: Use fuzzy_match() directly (zeertzjq).

closes: vim/vim#14987

2f95ca9fce

N/A patch:

vim-patch:9.1.0478: potential deref of NULL pointer in fuzzy_match_str_with_pos
2024-06-15 04:47:23 +08:00
zeertzjq
dc4037f612 vim-patch:9.1.0476: Cannot see matched text in popup menu
Problem:  Cannot see matched text in popup menu
Solution: Introduce 2 new highlighting groups: PmenuMatch and
          PmenuMatchSel (glepnir)

closes: vim/vim#14694

40c1c3317d

Co-authored-by: glepnir <glephunter@gmail.com>
2024-06-15 04:47:23 +08:00
Mathias Fußenegger
aa47af7e69
fix(lsp): tune completion word extraction for decorated labels (#29331)
Problem:

For snippets lsp.completion prefers the label if it is shorter than the
insertText or textEdit to support postfix completion cases but clangd
adds decoration characters to labels. E.g.: `•INT16_C(c)`

Solution:

Use parse_snippet on insertText/textEdit before checking if it is
shorter than the label.

Fixes https://github.com/neovim/neovim/issues/29301
2024-06-14 19:32:34 +02:00
Evgeni Chasnovski
458473acb8
fix(highlight): add StatusLineTerm/StatusLineTermNC to :color vim (#29313)
Problem: both `StatusLineTerm`/`StatusLineTermNC` are now explicitly
  used, but `:color vim` does not set them to the values used in Vim.
  This might be fine if `:color vim` is treated as "the state of default
  color scheme prior the big update", but it seems to be better treated
  as "Vim's default color scheme" (how it is documented in its header).

Solution: add `StatusLineTerm`/`StatusLineTermNC` definitions to
  'runtime/colors/vim.lua'.
  Use explicit foreground colors ('Whte'/'Black') instead of `guifg=bg`
  used in source, as the latter caused some problems in the past (if
  `Normal` is not defined, `nvim_set_hl()` can't recognize `'bg'` as the
  foreground value).
  Also realign the rest of the background conditional highlight groups.
2024-06-14 17:28:49 +08:00
Ilia Choly
0a9c81d709
refactor(lsp): use metatable for buf_versions (#29304)
This reduces the number of nil checks around buf_versions usage
Test changes were lifted from 5c33815

Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2024-06-14 11:03:58 +02:00
Tama McGlinn
81b372fecd
fix(lsp): check for nil response from server (#29196)
this only changes the error message, so that it is clear that
the error is with the LSP server, rather than being a crash inside
nvim runtime scripts. We are already doing a lot of validation,
it's just that nil was being overlooked here.

This fixes issue #27395
2024-06-14 11:02:36 +02:00
Yinzuo Jiang
29e05cfb7e
vim-patch:partial:9.1.0482: termdebug plugin needs more love (#29329)
Problem:  termdebug plugin needs more love
Solution: start with some more Vim9 refactoring
          to improve maintenance and readability
          (Ubaldo Tiberi)

List of Changes and the Reasoning Behind Them:

1) Introduction of InitScriptVariables() Function:

Reasoning: This function has been introduced to ensure that when you open and
close Termdebug, and then open it again, there are no leftover script variable
values from the previous session. Leftover values could potentially cause
issues. The goal is for each Termdebug session to be independent of previous
sessions. At startup, all script variables are initialized. The only exception
is g:termdebug_loaded located at the very beginning of the script to prevent
sourcing the script twice. The variables are declared at script level and
defined in InitScriptVariables().

2) More Descriptive Variable Names:

Reasoning: The names of variables have been made more comprehensive. Almost
every Termdebug buffer now has a variable to indicate its name and another
variable to indicate its number, improving code readability and
maintainability. Due to the latest discussion around the &mousemodel option
save/restore mechanism, perhaps some other variables shall be prepended with
saved_.

3) Consistent Naming for GDB Terminal Buffers:

Reasoning: The name of the GDB terminal buffer now matches the name of the GDB
program being used, e.g., 'gdb', 'mygdb', 'arm-eabi-none-gdb', etc. This
ensures clarity and consistency in identifying buffers.

4) Other minor improvements:
Moved EchoErr() on top, added another test, some refactoring, mainly changed
several 0 and 1 to true and false

closes: vim/vim#14980

ef8eab86e2

Co-authored-by: Ubaldo Tiberi <ubaldo.tiberi@volvo.com>
2024-06-14 16:37:38 +08:00
zeertzjq
874869321a
vim-patch:4407461: runtime(netrw): correctly test for windows in NetrwGlob() (#29330)
use has("win32") instead of has("win64") otherwise it
won't work on x86 systems.

440746158c

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-14 16:28:55 +08:00
zeertzjq
5def8714ad
fix(terminal): set local values of window options (#29326) 2024-06-14 06:20:42 +08:00
zeertzjq
4a24940980
vim-patch:1487947: runtime(netrw): glob() on windows fails with [] in directory name (#29324)
fixes: vim/vim#14952
closes: vim/vim#14991

1487947fb6

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-14 05:48:37 +08:00
zeertzjq
6ba1521687 vim-patch:d353d27: runtime(doc): restore description of "$" in col() and virtcol() (vim/vim#14981)
These are different from line() and getpos().

d353d27820
2024-06-14 04:49:21 +08:00
zeertzjq
fab3d4721f vim-patch:02f3eba: runtime(doc): deduplicate getpos(), line(), col(), virtcol()
Move the main description to getpos() and link to that from the other
functions.

closes: vim/vim#14970

02f3ebacfb
2024-06-14 04:49:18 +08:00
Christian Clason
f75053a00a vim-patch:902b766: runtime(java): Include element values in non-marker annotations (vim/vim#14979)
Make a formal definition for normal and single-element kinds
of annotations that otherwise require for their containment
to repeat each time all syntax groups that describe element
values.

Reference:
https://docs.oracle.com/javase/specs/jls/se21/html/jls-9.html#jls-9.7

902b766858

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2024-06-13 22:26:54 +02:00
Gregory Anders
6311a7fe4b
Merge pull request #29103 from gpanders/test-no-tgc
test: do not set termguicolors in test runner
2024-06-12 19:31:15 -05:00
Lewis Russell
53afdf360c
Merge pull request #29303 from lewis6991/fix/wobuf
fix(vim.wo): never allow non-zero bufnr
2024-06-12 17:30:11 +01:00
Gregory Anders
d38912b59f refactor(terminal): move :terminal defaults to _defaults.lua 2024-06-12 10:43:57 -05:00
Gregory Anders
3e09fbdf82 feat(highlight): add StatusLineTerm and StatusLineTermNC groups
These highlight groups are used for the statusline in :terminal windows.
By default they link to StatusLine and StatusLineNC (respectively), so
there is no visual difference unless a colorscheme defines these groups
separately.
2024-06-12 10:43:57 -05:00
Lewis Russell
8bf79bd13c fix(vim.wo): never allow non-zero bufnr 2024-06-12 15:42:56 +01:00
zeertzjq
7215512100
vim-patch:210b39c: runtime(doc): clarify documentation for "v" position at line() (#29296)
Problem: the previous documentation falsely states that "v" always
refers to the start of a visual area.  In fact, the reference of "v" and
"." complement each other.  If the cursor is at the start of
a (characterwise) visual area, then "v" refers to the end of the area.

Solution: be more verbose and explicit about the connection between "."
and "v" and also refer to |v_o| which many vim users will be familiar
with for visual areas.

210b39c2d6

Co-authored-by: Peter Aronoff <peter@aronoff.org>
2024-06-12 11:44:38 +08:00
zeertzjq
d73910d7f6
vim-patch:b4e648a: runtime(doc): fix typos in syntax.txt (#29293)
b4e648a006

Co-authored-by: Ken Takata <kentkt@csc.jp>
2024-06-12 11:07:22 +08:00
zeertzjq
bbe69b4022 vim-patch:959c3c8: runtime(vim): Update base-syntax, configurable comment string highlighting (vim/vim#14931)
Allow highlighting of strings within comments to be disabled by setting
g:vimsyn_comment_strings to false.

959c3c887b

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-06-12 10:29:19 +08:00
zeertzjq
c7799b1a23 vim-patch:059cbe8: runtime(vim): Update base-syntax, match multiline continued comments (vim/vim#13936)
Match multiline (continued) line comments.

Continued tail comments are not supported yet.

059cbe8933

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-06-12 10:22:50 +08:00
Christian Clason
66a1e028e6 vim-patch:2e3b2a8: runtime(kdl): use shiftwidth() instead of &tabstop in indent script
closes: vim/vim#14962

2e3b2a8d89

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-06-12 00:02:39 +02:00
Gregory Anders
3ad977f01d
feat(terminal): add support for copying with OSC 52 in embedded terminal (#29117)
When libvterm receives the OSC 52 escape sequence it ignores it because
Nvim does not set any selection callbacks. Install selection callbacks
that forward to the clipboard provider, so that setting the clipboard
with OSC 52 in the embedded terminal writes to the system clipboard
using the configured clipboard provider.
2024-06-11 13:18:06 -05:00
notomo
44410d063a fix(types): add some vim.fn type annotations
Problem: Some vim.fn have no type annotations.

Solution: Add type annotations.
2024-06-11 16:37:15 +01:00
Will Hopkins
e947f226be fix(types): use vararg return type annotation
build(types): allow vararg returns in function types
2024-06-11 16:36:29 +01:00
Christian Clason
c06f3dbe3e vim-patch:2d88210: runtime(kdl): include syntax, indent and ftplugin files
closes: vim/vim#14956

2d88210b3c

Co-authored-by: inzuo Jiang <jiangyinzuo@foxmail.com>
Co-authored-by: Aram Drevekenin <aram@poor.dev>
2024-06-11 14:00:11 +02:00
Christian Clason
04d3ad1ded vim-patch:b8076f9: runtime(deb822sources): add missing Enabled field in syntax script
closes: vim/vim#14898

It lacks the support of Enabled: boolean option field [1]:

e.g.

  Types: deb
  Uris: https://paulcarroty.gitlab.io/vscodium-deb-rpm-repo/debs/
  Components: main
  Suites: vscodium
  Architectures: amd64 i386 arm64 armhf
  Enabled: yes
  Signed-By: /var/lib/extrepo/keys/vscodium.asc

This patch was also forwarded to upstream. [2]

[1] https://manpages.debian.org/unstable/apt/sources.list.5.en.html#DEB822-STYLE_FORMAT
[2] https://salsa.debian.org/vim-team/vim-debian/-/merge_requests/16

b8076f92a1

Co-authored-by: Kentaro Hayashi <kenhys@gmail.com>
2024-06-11 14:00:11 +02:00
Christian Clason
34b7e00eed vim-patch:7e9a1a7: runtime(svelte): basic svelte ftplugin file
closes: vim/vim#14949

7e9a1a75b8

Co-authored-by: Igor <igorlfs@ufmg.br>
2024-06-11 14:00:11 +02:00
Lewis Russell
5e49ef0af3 refactor(lua): improve type annotations 2024-06-11 12:45:43 +01:00
belkka
2c160f39d3 fix(ftplugin/man.vim): hide signcolumn (auto)
Problem:
It's a common practice to set 'signcolumn=yes' (always show) instead of default 'signcolumn=auto' in order to prevent annoying horizontal shifting in editable buffers when using some popular plugins that add/remove signs on the fly. This makes signcolumn always visible and breaks the text flow of pre-formatted man pages, even when no signs are actually defined. Some other options are already tweaked in man.vim to address the issue (e.g. 'nonumber'), but not signcolumn.

Solution:
set 'signcolumn=auto' in ftplugin/man.vim.
By default there is no |signs| in man pages anyway (and I am not aware of any plugins that could define them in man pages), so 'signcolumn=auto' should behave like 'signcolumn=no', i.e. hide the empty column in order to keep buffer width same as terminal width.
In a (rare?) case when user does define some signs in man pages, signcolumn will appear (breaking the text flow).
2024-06-11 04:58:18 +03:00
belkka
3cf1c70c70 refactor(ftplugin/man.vim): rearrange setlocal commands
Problem:
1. multiple `setlocal` commands are spread across the script.
2. several options, apparently, serve the same purpose (hide UI columns) which may not be immediately clear. more options may be required to fullfill the same purpose or they could be removed all together as a group if better solution is found later
3. `setlocal nofoldenable` may be overriden by conditional block later in the script.

Solution:
1. move 'colorcolumn' and 'nolist' to the group of other options at the beginning
2. add an explanatory comment about options that disable UI columns
3. move 'nofoldenable' to the if-else block to keep relevant commands coupled
2024-06-11 04:09:50 +03:00
Ilia Choly
37bf4c572a
fix(lsp): do not reset buf version when detaching client (#29242) 2024-06-10 18:53:08 +02:00
Justin M. Keyes
d9af8c2431
Merge #29238 from clason/feat/help-toc 2024-06-10 05:22:27 -07:00
Jon Huhn
4bd86120d4
fix(glob): handle overlapping {} condition elements #29236
This change fixes an issue where glob patterns like `{a,ab}` would not
match `ab` because the first option `a` matches, then the end of the
string is expected but `b` is found, and LPeg does not backtrack to try
the next option `ab` which would match. The fix here is to also append
the rest of the pattern to the generated LPeg pattern for each option.
This changes a glob `{a,ab}` from being parsed as

    ("a" or "ab") "end of string"

to

    ("a" "end of string" or "ab" "end of string")

Here, matching against `ab` would try the first option, fail to match,
then proceed to the next option, and match.

The sacrifice this change makes is dropping support for nested `{}`
conditions, which VSCode doesn't seem to support or test AFAICT.

Fixes #28931

Co-authored-by: Sergey Slipchenko <faergeek@gmail.com>
2024-06-10 04:23:03 -07:00
Tom Praschan
20f22f75ee
feat(lsp): include end_col, end_lnum in vim.lsp.buf.locations_to_items #29164 2024-06-09 18:14:55 -07:00
zeertzjq
40329f32d8
vim-patch:9c4389a: runtime(doc): Fix small style issues (#29263)
closes: vim/vim#14942

9c4389acc3

Co-authored-by: h-east <h.east.727@gmail.com>
2024-06-10 06:47:30 +08:00
Christian Clason
2f752d6ad4 vim-patch:d6b4afb: runtime(java): Exclude lambda expressions from _when_ _switch-case_ label clauses (vim/vim#14945)
These guard clauses are always boolean expressions, whereas
lambda expressions can only appear in either an assignment,
a casting, or an invocation context.

References:
https://docs.oracle.com/javase/specs/jls/se21/html/jls-14.html#jls-14.11.1
https://docs.oracle.com/javase/specs/jls/se21/html/jls-15.html#jls-15.27

d6b4afb636

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2024-06-10 00:23:18 +02:00
Samuel Born
b6c1ce8a95 fix(runtime): add commentstring for glsl ftplugin 2024-06-09 14:51:22 +02:00
Christian Clason
a156038d70 docs: fix more treesitter parsing errors 2024-06-09 13:54:34 +02:00
Christian Clason
6592873f77 feat(help): use treesitter for table of contents
Problem: Creating the table of contents for `gO` is complicated.

Solution: Use treesitter instead.
2024-06-09 13:54:34 +02:00
dundargoc
9afa1fd355 feat(lua): add vim._with
It's a function to perform operations in their own sealed context,
similar to pythons `with`. This helps ease operations where you need to
perform an operation in a specific context, and then restore the
context.

Marked as private for now as it's not ready for public use. The current
plan is to start using this internally so we can discover and fix any
problems. Once this is ready to be exposed it will be renamed to
`vim.with`.

Usage:

```lua
local ret = vim._with({context = val}, function()
  return "hello"
end)
```

, where `context` is any combination of:

- `buf`
- `emsg_silent`
- `hide`
- `horizontal`
- `keepalt`
- `keepjumps`
- `keepmarks`
- `keeppatterns`
- `lockmarks`
- `noautocmd`
- `options`
- `sandbox`
- `silent`
- `unsilent`
- `win`

(except for `win` and `buf` which can't be used at the same time). This
list will most likely be expanded in the future.

Work on https://github.com/neovim/neovim/issues/19832.

Co-authored-by: Lewis Russell <lewis6991@gmail.com>
2024-06-08 21:38:06 +02:00
Christian Clason
105a9e3dcf build(deps): bump tree-sitter-vimdoc to v3.0.0 2024-06-08 10:19:28 +02:00
Lennard Hofmann
da6f68ee69
fix(man): filter OSC 8 hyperlink markup #29171
Problem: `man cmake` shows "8;;https://cmake.orghttps://cmake.org8;;"
Solution: Remove noise so that it shows as "https://cmake.org".
See also: https://en.wikipedia.org/wiki/ANSI_escape_code#OSC
2024-06-07 12:43:17 -07:00
altermo
f3632e14e3
feat: get/set namespace properties #28728
ref https://github.com/neovim/neovim/pull/28432
ref https://github.com/neovim/neovim/issues/28469
2024-06-07 08:33:40 -07:00
Al Colmenar
2ce4a4d91e
fix(lsp): fix reverse sorting of same position text edits (#29212)
Problem:
Text edits with the same position (both line and character) were being
reverse sorted prior to being applied which differs from the lsp spec

Solution:
Change the sort order for just the same position edits
2024-06-07 11:54:43 +02:00
Mathias Fußenegger
6e45cd7f00
fix(lsp): revert buf_versions deprecation/replacement (#29217)
* Revert "fix(lsp): account for changedtick version gap on modified reset (#29170)"

This reverts commit 2e6d295f79.

* Revert "refactor(lsp): replace util.buf_versions with changedtick (#28943)"

This reverts commit 5c33815448.
2024-06-07 11:36:46 +02:00
dundargoc
8c5af0eb85
docs: misc (#28837)
Co-authored-by: Danymat <d.danymat@gmail.com>
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: Jakub Okoński <jakub@okonski.org>
Co-authored-by: John L. Villalovos <john@sodarock.com>
Co-authored-by: Maria José Solano <majosolano99@gmail.com>
Co-authored-by: Michaili K <git@michaili.dev>
Co-authored-by: TheLeoP <eugenio2305@hotmail.com>
Co-authored-by: Tobias Schmitz <tobiasschmitz2001@gmail.com>
Co-authored-by: W20MC <157727813+W20MC@users.noreply.github.com>
Co-authored-by: Will Hopkins <willothyh@gmail.com>
Co-authored-by: Yifan Hu <141280278+b0ae989c@users.noreply.github.com>
Co-authored-by: glepnir <glephunter@gmail.com>
Co-authored-by: prljav <74116121+prljav@users.noreply.github.com>
2024-06-07 10:55:14 +08:00
Christian Clason
d490a7bc5b vim-patch:ce47d32: runtime(cpp): Change 'cms' for C++ to '// %s'
fixes: vim/vim#14911
closes: vim/vim#14926

ce47d32b03

Co-authored-by: Luc Hermitte <luc.hermitte@csgroup.eu>
2024-06-07 00:17:56 +02:00
sus-domesticus
cb6c0fda71
feat(editorconfig): add support for spelling_language (#28638) 2024-06-06 09:16:43 -05:00
zeertzjq
78d3f47428
vim-patch:92f4e91: runtime(vim): Update base-syntax, allow whitespace before :substitute pattern (#29210)
Allow whitespace between the :substitute command and its pattern
argument.  Although unusual, it is supported and there are examples in
the wild.

Match Vi compatible :substitute commands like :s\/{string}/.  See :help
E1270.

fixes: vim/vim#14920
closes: vim/vim#14923

92f4e91590

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-06-06 06:40:11 +08:00
zeertzjq
1d4e894403 vim-patch:9.1.0469: Cannot have buffer-local value for 'completeopt'
Problem:  Cannot have buffer-local value for 'completeopt'
          (Nick Jensen).
Solution: Make 'completeopt' global-local (zeertzjq).

Also for some reason test Test_ColonEight_MultiByte seems to be failing
sporadically now. Let's mark it as flaky.

fixes: vim/vim#5487
closes: vim/vim#14922

529b9ad62a
2024-06-06 06:07:31 +08:00
Gregory Anders
d7651b27d5
fix(tui): move $COLORTERM check to _defaults.lua (#29197)
We currently check $COLORTERM in the TUI process to determine if the
terminal supports 24 bit color (truecolor). If $COLORTERM is "truecolor"
or "24bit" then we automatically assume that the terminal supports
truecolor, but if $COLORTERM is set to any other value we still query
the terminal.

The `rgb` flag of the UI struct is a boolean which only indicates
whether the UI supports truecolor, but does not have a 3rd state that we
can use to represent "we don't know if the UI supports truecolor". We
currently use `rgb=false` to represent this "we don't know" state, and
we use XTGETTCAP and DECRQSS queries to determine at runtime if the
terminal supports truecolor. However, if $COLORTERM is set to a value
besides "truecolor" or "24bit" (e.g. "256" or "16) that is a clear
indication that the terminal _does not_ support truecolor, so it is
incorrect to treat `rgb=false` as "we don't know" in that case.

Instead, in the TUI process we only check for the terminfo capabilities.
This must be done in the TUI process because we do not have access to
this information in the core Neovim process when `_defaults.lua` runs.
If the TUI cannot determine truecolor support from terminfo alone, we
set `rgb=false` to indicate "we don't know if the terminal supports
truecolor yet, keep checking". When we get to `_defaults.lua`, we can
then check $COLORTERM and only query the terminal if it is unset.

This means that users can explicitly opt out of truecolor determination
by setting `COLORTERM=256` (or similar) in their environment.
2024-06-05 08:27:56 -05:00
zeertzjq
43bd9c9c1c
fix(lua): don't clamp -1 or v:maxcol in vim.highlight.range() (#29203) 2024-06-05 16:47:43 +08:00
zeertzjq
c2e836c41c vim-patch:2a2c4ff: runtime(doc): clarify how fuzzy 'completeopt' should work
related: vim/vim#14912

2a2c4fffd7

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-05 15:08:31 +08:00
zeertzjq
164338330b vim-patch:9.1.0463: no fuzzy-matching support for insert-completion
Problem:  no fuzzy-matching support for insert-completion
Solution: enable insert-mode completion with fuzzy-matching
          using :set completopt+=fuzzy (glepnir).

closes: vim/vim#14878

a218cc6cda

Co-authored-by: glepnir <glephunter@gmail.com>
2024-06-05 15:08:31 +08:00
Andre Toerien
f69937fdbd
fix(diagnostic): fix float scope filtering (#29134) 2024-06-04 16:35:44 -05:00
Christian Clason
946a839aa9 vim-patch:98b73eb: runtime(netrw): prevent accidental data loss
fixes: vim/vim#14915

98b73eb645

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-04 23:15:50 +02:00
Saltaformajo
230bc34ca5
fix(lsp): check if buffer is valid before LspDetach autocmd (#29162) 2024-06-04 17:23:57 +02:00
jdrouhard
43581011e4
fix(lsp): remove superfluous on_detach callback from semantic tokens module (#29174)
LspDetach is now triggered by the main on_detach callback that is added
when an LSP client is attached to a buffer. The semantic_tokens module
already includes a LspDetach handler that does the right thing. When the
LspDetach trigger was added to the main LSP on_detach, it created a race
condition in semantic tokens when a buffer was deleted that would
trigger both its own on_detach and the LspDetach handlers. If the former
came last, an error was thrown trying to delete a non-existent augroup
(destroy() was being called twice).
2024-06-04 17:22:02 +02:00
Mathias Fußenegger
2e6d295f79
fix(lsp): account for changedtick version gap on modified reset (#29170)
Follow up to https://github.com/neovim/neovim/pull/28943
Fixes https://github.com/neovim/neovim/issues/29163
2024-06-04 17:21:37 +02:00
Ilia Choly
8cbb1f20e5
refactor(lua): use tuple syntax everywhere #29111 2024-06-04 06:06:02 -07:00
Christian Clason
8369590eb2 fix(runtime): remove obsolete ftplugin/calender.lua 2024-06-04 12:54:34 +02:00
Evgeni Chasnovski
aa9f21ee95 fix(filetype): fix typos in filetype detection 2024-06-04 11:26:27 +02:00
Christian Clason
2f5b8a0092 vim-patch:9.1.0464: no whitespace padding in commentstring option in ftplugins
Problem:  no whitespace padding in commentstring option in ftplugins
Solution: Change default to include whitespace padding, update
          existing filetype plugins with the new default value
          (Riley Bruins)

closes: vim/vim#14843

0a0830624a

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-06-04 10:38:55 +02:00
ippachi
5aa9906676
fix(lsp): use client.id instead of pairs index (#29143)
Problem: Completion side effects not working randomly.

Solution: When creating the table of LSP responses, the table index
was used, but this is not the same as the actual client_id, so it was changed
to use the client_id directly.
2024-06-03 18:07:09 +02:00
dundargoc
a9c89bcbf6 fix(gx): allow @ in url
This will make `gx` work for links for the form
https://hachyderm.io/@neovim.
2024-06-03 15:33:10 +02:00
Soham Shanbhag
054a287dbe
feat(ftplugin): change 'commentstring' to // %s for C/C++ (#29085)
Problem: The default commentstring for C/C++ can lead to invalid code 
when commenting and does not match the Nvim codebase.

Solution: Change commentstring to `// %s` as used by Neovim. Also
set all commentstrings that derive from the default C string explicitly
(and correctly).
2024-06-03 09:48:43 +02:00
Christian Clason
659d3dcd2e vim-patch:9.1.0460: filetype: lintstagedrc files are not recognized
Problem:  filetype: lintstagedrc files are not recognized
Solution: recognize '.lintstagedrc' files as json filetype
          (İlyas Akın)

see: https://github.com/lint-staged/lint-staged

closes: vim/vim#14897

7577afd5ef

Co-authored-by: İlyas Akın <ilyas.akin@kuika.com>
2024-06-02 23:01:20 +02:00
Mathias Fußenegger
19be3d2683
fix(lsp): trim trailing whitespace from completion words (#29122)
the `complete()` mechanism doesn't play nicely with trailing newlines or
tabs. A newline causes it to insert a null character, showing up as
`^@`.
2024-06-02 09:54:15 +02:00
zeertzjq
7a8f42dc03
vim-patch:e299591: runtime(doc): clarify 'shortmess' flag "S" (#29131)
fixes: vim/vim#14893

e299591498

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-02 06:06:12 +08:00
Mathias Fussenegger
138a93a057 perf(lsp): avoid repeated table lookup in completion.enable 2024-06-01 10:23:01 +02:00
Mathias Fussenegger
4c938f6d72 refactor(lsp): share completion request logic between omnifunc & trigger 2024-06-01 10:23:01 +02:00
Mathias Fussenegger
cc1f2d2ca6 perf(lsp): don't copy completion items in filter pass 2024-06-01 10:23:01 +02:00