Commit Graph

7610 Commits

Author SHA1 Message Date
zeertzjq
221c489edd vim-patch:8d52926: runtime(zip): add a generic Message function
Problem:  the zip plugin duplicates a lot of code for displaying
          warnings/errors
Solution: refactor common code into a generic Mess() function

8d52926857

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-07 07:16:26 +08:00
zeertzjq
025920b330 vim-patch:a336d8f: runtime(zip): increment base version of zip plugin
Problem:  the zip plugin version is still v33
Solution: increment the version to v34

a336d8f21e

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-07 07:16:26 +08:00
zeertzjq
92981c8e0b vim-patch:19636be: runtime(zip): refactor save and restore of options
Problem:  zip plugin has no way to set/restore option values
Solution: Add the SetSaneOpts() and RestoreOpts() functions,
          so options that cause issues are set to sane values
          and restored back to their initial values later on.
          (this affects the 'shellslash' option on windows, which also
          changes how the shellescape() function works)

19636be55e

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-07 07:07:34 +08:00
zeertzjq
11c57c25ef vim-patch:33836d3: runtime(zip): remove test for fnameescape
Problem:  zip plugin tests for fnameescape() function
Solution: Remove the check, fnameescape() has been available since
          7.1.299, it should nowadays always be available

33836d38b8

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-07 07:07:07 +08:00
zeertzjq
303b3e153d vim-patch:120c0dd: runtime(zip): use :echomsg instead of :echo
Problem:  zip plugin uses :echo which does not store messages
Solution: use :echomsg instead of :echo so that messages are stored in
          the message history

120c0dd815

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-07 07:06:35 +08:00
zeertzjq
0bf9a574b5 vim-patch:a63f66e: runtime(zip): clean up and remove comments
Problem:  zip plugin contains a lot of comments from the decho plugin
Solution: Clean up and remove un-used comments

a63f66e953

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-07 07:06:03 +08:00
Yi Ming
0a1212ef94 docs(treesitter): generate inline docs for Ranges
docs(treesitter): in-place parameter description

docs(treesitter): remove internal type names

docs(treesitter): add missing private annotation
2024-08-06 18:18:34 +02:00
zeertzjq
37952bf7b4
vim-patch:8.2.4838: checking for absolute path is not trivial (#29990)
Problem:    Checking for absolute path is not trivial.
Solution:   Add isabsolutepath(). (closes vim/vim#10303)

dca1d40cd0

vim-patch:8a3b805c6c9c

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-08-06 21:19:12 +08:00
zeertzjq
28fbba2092
vim-patch:9.1.0465: missing filecopy() function (#29989)
Problem:  missing filecopy() function
Solution: implement filecopy() Vim script function
          (Shougo Matsushita)

closes: vim/vim#12346

60c8743ab6

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2024-08-06 12:49:59 +00:00
zeertzjq
6f5b904fb2 vim-patch:f0e9b72: runtime(zip): Fix for FreeBSD's unzip command
Problem:  Cannot browse zipfiles with the unzip program found
	  on FreeBSD.
Solution: Adjust command arguments.

Unzip found on FreeBSD complain about missing argument with the
zipinfo modifier '-Z -1'. Joining arguments seems to work
for both implementations.

Also change `:sil!` to `:sil` so that error messages are properly
reported (per review of Christian Brabandt).

related: vim/vim#15411

f0e9b72c8f

Co-authored-by: Damien <141588647+xrandomname@users.noreply.github.com>
2024-08-06 06:47:53 +08:00
zeertzjq
9a30abb292 vim-patch:217d3c1: runtime(doc): capitalize correctly
* do not capitalize after a double colon when introducing a list
* Capitalize a header line

closes: vim/vim#15433

217d3c17c6

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-06 06:47:30 +08:00
Christian Clason
28e2e8aa04 vim-patch:c0f7505: runtime(lua): add/subtract a 'shiftwidth' after '('/')' in indentexpr
Problem:

- Current lua indentexpr does not indent for '(' ')'.
- Missing indent test for lua.

Solution:

- Match '(', ')' in `function GetLuaIndentIntern`.
- Add an indent test for lua.

closes: vim/vim#15364

c0f7505ede

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-08-04 19:00:10 +02:00
Christian Clason
be9eaac7e8 vim-patch:c5bdd66: runtime(zip): escape '[' on Unix as well
Problem:  After 6f1cbfc9ab fnameescape()
          is no longer called on the name of the file to be extracted.
          However, while spaces indeed don't need to be escaped, unzip
          treats '[' as a wildcard character, so it need to be escaped.
Solution: Escape '[' on both MS-Windows and Unix.

From the docs it seems '*' and '?' also need escaping, but they seem to
actually work without escaping.

fixes: neovim/neovim#29977
closes: vim/vim#15427

c5bdd66558

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-08-04 18:59:38 +02:00
zeertzjq
58406ab9f0
vim-patch:947f752: runtime(doc): fix typo in syntax.txt (#29974)
closes: vim/vim#15425

947f752a47

Co-authored-by: Jon Parise <jon@indelible.org>
2024-08-04 06:09:54 +08:00
Christian Clason
ac24b907f0 vim-patch:6228481: runtime(colors): update Todo highlight in habamax colorscheme
Magenta background Todo is too bright and might interfere with DiffText.
Make it less strong, without background, bold.

closes: vim/vim#15423

6228481b8e

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-08-03 15:22:11 +02:00
Christian Clason
3b58d93aae docs(filetype): consolidate comments in dev_vimpatch.txt 2024-08-03 14:14:42 +02:00
Evgeni Chasnovski
37910f2703 docs(filetype): add note about prefering explicit lists over pattern 2024-08-03 14:14:42 +02:00
Evgeni Chasnovski
95e0289cb2 refactor(filetype): use extension match instead of pattern if possible
Problem: some patterns are used as a replacement for several explicit
  extension matches (like '%.[Ss][Yy][Ss]$', '%.php%d$', etc.).
  They usually correspond to Vim's "ignore case" regexes (like
  '*.sys\c') and "convenience" patterns to not define many of them (like
  '*.php\d').
  As matching extension directly is faster and more explicit, it should
  be preferred.
Solution: move all such patterns to direct extension match.
2024-08-03 14:14:42 +02:00
Evgeni Chasnovski
66a74535d4 refactor(filetype): use file name match instead of pattern if possible
Problem: some patterns are used as a replacement for one-two explicit
  file matches (like '^[mM]akefile$'). As matching file name directly is
  faster and more explicit, it should be preferred.
Solution: move those patterns to direct file name match.
  NOTE: this is not strictly backwards compatible, because exact file
  name matching is done *before* pattern matching. If user has
  conflicting `vim.filetype.add()` call with high priority (like with
  `pattern='file$'` and `priority=100`), after this change it will be
  ignored (i.e. 'makefile' will match exactly).
  Judging by converted cases, it seems reasonable to prefer exact
  matches there.
2024-08-03 14:14:42 +02:00
Jaehwang Jung
eb629cce91
fix(lsp): redundant spaces in lsp log (#29970) 2024-08-03 11:14:34 +02:00
Mathias Fußenegger
6072153796
feat(lsp): announce codeLens resolveSupport (#29956)
The codelens implementation can resolve command via `codeLens/resolve`.

The spec added client capabilities for that:

https://github.com/microsoft/language-server-protocol/pull/1979
2024-08-03 11:14:12 +02:00
Christian Clason
e7f8349a2e vim-patch:9.1.0655: filetype: goaccess config file not recognized
Problem:  filetype: goaccess config file not recognized
Solution: detect 'goaccess.conf' as goaccess filetype, also
          include a basic syntax and ftplugin (Adam Monsen)

Add syntax highlighting for GoAccess configuration file.

GoAccess is a real-time web log analyzer and interactive viewer that
runs in a terminal in *nix systems or through your browser.

GoAccess home page: https://goaccess.io

closes: vim/vim#15414

0aa65b48fb

Co-authored-by: Adam Monsen <haircut@gmail.com>
2024-08-03 00:16:22 +02:00
Christian Clason
a90b1b7c6f vim-patch:c527d90: runtime(netrw): honor g:netrw_alt{o,v} for :{S,H,V}explore
Make `:Sexplore` / `:Hexplore` / `:Vexplore` commands honor the user
`&split{right,below}` settings (or netrw-specific `g:netrw_alt{o,v}`)
instead of hardcoding a split direction. Similarly, update banged
variants of the two latter commands to follow the inverted preference.

closes: vim/vim#15417

c527d90fae

Co-authored-by: Ivan Shapovalov <intelfx@intelfx.name>
2024-08-03 00:16:09 +02:00
zeertzjq
99bb0a10d3 refactor(eval): treat v:lua call as simple function 2024-08-02 12:56:57 +08:00
zeertzjq
582bf4f1e1 vim-patch:9.0.0634: evaluating "expr" options has more overhead than needed
Problem:    Evaluating "expr" options has more overhead than needed.
Solution:   Use call_simple_func() for 'foldtext', 'includeexpr', 'printexpr',
            "expr" of 'spellsuggest', 'diffexpr', 'patchexpr', 'balloonexpr',
            'formatexpr', 'indentexpr' and 'charconvert'.

a4e0b9785e

vim-patch:9.0.0635: build error and compiler warnings

Problem:    Build error and compiler warnings.
Solution:   Add missing change.  Add type casts.

3292a22940

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-08-02 11:56:51 +08:00
zeertzjq
f7fde0173a vim-patch:9.0.0632: calling a function from an "expr" option has overhead
Problem:    Calling a function from an "expr" option has too much overhead.
Solution:   Add call_simple_func() and use it for 'foldexpr'

87b4e5c5db

Cherry-pick a call_func() change from patch 8.2.1343.
Add expr-option-function docs to options.txt.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-08-02 11:56:51 +08:00
zeertzjq
48e4589ead
vim-patch:8.2.4416: Vim9: using a script-local function requires using "s:" (#29950)
Problem:    Vim9: using a script-local function requires using "s:" when
            setting 'completefunc'.
Solution:   Do not require "s:" in Vim9 script. (closes vim/vim#9796)

1fca5f3e86

vim-patch:8.2.4417: using NULL pointer

Problem:    Using NULL pointer.
Solution:   Set offset after checking for NULL pointer.

e89bfd212b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-08-02 02:58:10 +00:00
Mathias Fußenegger
720b309c78
fix(lsp): don't send foreign diagnostics to servers in buf.code_action (#29501)
`buf.code_action` always included diagnostics on a given line from all
clients. Servers should only receive diagnostics they published, and in
the exact same format they sent it.

Should fix https://github.com/neovim/neovim/issues/29500
2024-08-01 16:01:15 +02:00
Manuel
32e128f209
fix(watch): exclude .git when using inotifywait (#29914)
inotifywait man page specifies:
The file must be specified with a relative or absolute path according to whether a relative or absolute path is given for watched directories.

So it would only work this way in case the path is relative (which at least for gopls it is not)
2024-08-01 16:00:48 +02:00
Christian Clason
d3019419e7 vim-patch:30a8ad6: runtime(java): Document "g:java_space_errors" and "g:java_comment_strings"
closes: vim/vim#15399

30a8ad675d

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-08-01 10:14:10 +02:00
Christian Clason
2339bd894b vim-patch:77b87c3: runtime(java): Cluster optional group definitions and their group links
And keep non-optional group links at the end of the file.

related: vim/vim#15399

77b87c30d9

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-08-01 10:14:10 +02:00
Christian Clason
13a4e61231 vim-patch:9aabcef: runtime(java): Tidy up the syntax file
- Prefix all global variables with "g:".
- Add spaces around each variable assignment operator.
- Remove extraneous whitespace characters.
- Remove a spurious _serializable_ Java keyword (since v1.1,
  java.io.Serializable and java.io.Externalizable interfaces
  provide an API for object serialization; see vim-6-0j).
- Normalise the syntax definition argument order by making
  _contained_ the first argument of each such definition.
- Normalise the argument tabulation for highlighting group
  definitions.

Reference:
https://web.archive.org/web/20010821025330/java.sun.com/docs/books/jls/first_edition/html/1.1Update.html

related: vim/vim#15399

9aabcef1c8

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-08-01 10:14:10 +02:00
Christian Clason
a70371ff00 vim-patch:3749dff: runtime(java): Tidy up the documentation for "ft-java-syntax"
- Reword a few sentences and reformat a few paragraphs.
- Supply absent capitalisation and punctuation.
- Make listed highlighting groups and code stand out.
- Prefix all Java-related global variables with "g:".
- Add spaces around each variable assignment operator.
- Acknowledge that some Javadoc variables are maintained in
  the HTML syntax file.

Also, move the overridable _default_ HTML group links before
the HTML syntax file inclusion in order to implement the
documented diverged settings.

related: vim/vim#15399

3749dff093

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-08-01 10:14:10 +02:00
zeertzjq
b7dec93e68
vim-patch:5b07213: runtime(doc): re-format tag example lines, mention ctags --list-kinds (#29938)
5b07213c0b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-01 08:00:41 +00:00
zeertzjq
2b4049719a
vim-patch:partial:f10911e: Update runtime files (#29936)
f10911e5db

Also cherry-pick E1142 and E1156 tags from Vim.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-08-01 03:50:38 +00:00
Christian Clason
e820474cde vim-patch:d88ebcb: runtime(colors): update habamax scheme - tweak diff/search/todo colors
- Make diff colors more accessible, Green for added, Red for deleted, Blue for Changed
- Change Search to blue to be visible with Diff colors
- Change Todo to bright magenta

closes: vim/vim#15400

d88ebcbd9f

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-08-01 00:07:31 +02:00
Christian Clason
9e5381d1ad vim-patch:fcc5346: runtime(colors): update included colorschemes
- Add PmenuMatch and PmenuMatchSel to all colorschemes
- Add contrast to habamax Type, String, Constant and PreProc
- Change habamax PmenuSel to neutral gray to make PmenuMatchSel more visible
- Change habamax Tabline and VertSplit
- Make Conceal less visible for zellner, torte, shine, ron, peachpuff,
  pablo, morning, koehler, evening, delek, blue, darkblue, lunaperche,
  retrobox
- Add Added/Changed/Removed highlights
- Fix retrobox Terminal background
- Other minor fixes and improvements

closes: vim/vim#15267

fcc53461d4

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-08-01 00:07:31 +02:00
Christian Clason
e1d48d5cf2 vim-patch:5753d99: runtime(nohlsearch): add missing loaded_hlsearch guard
related: vim/vim#15039
closes: vim/vim#15402

5753d99ff6

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-07-31 23:06:28 +02:00
Christian Clason
479af3b006 vim-patch:56e8ed6: runtime(kivy): Updated maintainer info for syntax script
closes: vim/vim#15405

56e8ed6162

Co-authored-by: Corey Prophitt <git@prophitt.me>
2024-07-31 23:06:28 +02:00
Jaehwang Jung
6bb40f3dbf
fix(lsp): prevent desync due to empty buffer (#29904)
Problem:
Some language servers (e.g., rust-analyzer, texlab) are desynced when
the user deletes the entire contents of the buffer. This is due to the
discrepancy between how nvim computes diff and how nvim treats empty
buffer.
* diff: If the buffer became empty, then the diff includes the last
  line's eol.
* empty buffer: Even if the buffer is empty, nvim regards it as having
  a single empty line with eol.

Solution:
Add special case for diff computation when the buffer becomes empty so
that it does not include the eol of the last line.
2024-07-31 16:18:24 +02:00
glepnir
4e90bc3023
feat(lsp): lsp.completion support set deprecated (#29882)
Problem: CompletionItem in lsp spec mentioned the deprecated attribute

Solution: when item has deprecated attribute set hl_group to DiagnosticDeprecated
          in complete function
2024-07-31 16:15:34 +02:00
Lewis Russell
573a71469d fix(scrollbind): properly take filler/virtual lines into account
Problem:

`'scrollbind'` does not work properly if the window being scrolled
automatically contains any filler/virtual lines (except for diff filler
lines).

This is because when the scrollbind check is done, the logic only
considers changes to topline which are represented as line numbers.

Solution:

Write the logic for determine the scroll amount to take into account
filler/virtual lines.

Fixes #29751
2024-07-31 11:33:32 +01:00
zeertzjq
e57598fbef vim-patch:9.1.0645: regex: wrong match when searching multi-byte char case-insensitive
Problem:  regex: wrong match when searching multi-byte char
          case-insensitive (diffsetter)
Solution: Apply proper case-folding for characters and search-string

This patch does the following 4 things:

1) When the regexp engine compares two utf-8 codepoints case
   insensitive it may match an adjacent character, because it assumes
   it can step over as many bytes as the pattern contains.

   This however is not necessarily true because of case-folding, a
   multi-byte UTF-8 character can be considered equal to some
   single-byte value.

   Let's consider the pattern 'ſ' and the string 's'. When comparing and
   ignoring case, the single character 's' matches, and since it matches
   Vim will try to step over the match (by the amount of bytes of the
   pattern), assuming that since it matches, the length of both strings is
   the same.

   However in that case, it should only step over the single byte value
   's' by 1 byte and try to start matching after it again. So for the
   backtracking engine we need to ensure:
   * we try to match the correct length for the pattern and the text
   * in case of a match, we step over it correctly

   There is one tricky thing for the backtracing engine. We also need to
   calculate correctly the number of bytes to compare the 2 different
   utf-8 strings s1 and s2. So we will count the number of characters in
   s1 that the byte len specified. Then we count the number of bytes to
   step over the same number of characters in string s2 and then we can
   correctly compare the 2 utf-8 strings.

2) A similar thing can happen for the NFA engine, when skipping to the
   next character to test for a match. We are skipping over the regstart
   pointer, however we do not consider the case that because of
   case-folding we may need to adjust the number of bytes to skip over.
   So this needs to be adjusted in find_match_text() as well.

3) A related issue turned out, when prog->match_text is actually empty.
   In that case we should try to find the next match and skip this
   condition.

4) When comparing characters using collections, we must also apply case
   folding to each character in the collection and not just to the
   current character from the search string.  This doesn't apply to the
   NFA engine, because internally it converts collections to branches
   [abc] -> a\|b\|c

fixes: vim/vim#14294
closes: vim/vim#14756

22e8e12d9f

N/A patches:
vim-patch:9.0.1771: regex: combining chars in collections not handled
vim-patch:9.0.1777: patch 9.0.1771 causes problems

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-31 08:03:31 +08:00
Christian Clason
617810d72d vim-patch:e34d0e3: runtime(netrw): removing trailing slash when copying files in same directory
closes: vim/vim#14756

e34d0e37e3

Co-authored-by: Travis Shelton <tshelton.mail@gmail.com>
2024-07-31 00:19:03 +02:00
Christian Clason
bd6bef60ba vim-patch:e6471b4: runtime(cuda): source c and cpp ftplugins
closes: vim/vim#15383

e6471b415b

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-07-31 00:18:52 +02:00
Christian Clason
34fa34e720 vim-patch:c4be066: runtime(zip): Opening a remote zipfile don't work
Problem:  Opening a zipfile from HTTP gives an empty buffer.
Solution: Ensure that the magic bytes check does not
          skip protocol processing.

Also use readblob() and remove commented out lines.

closes: vim/vim#15396

c4be066817

Co-authored-by: Damien <141588647+xrandomname@users.noreply.github.com>
2024-07-31 00:18:43 +02:00
Christian Clason
1dd2bf926d vim-patch:df9f67e: runtime(html): update syntax script to sync by 250 minlines by default
closes: vim/vim#14071

df9f67e10d

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-31 00:18:32 +02:00
Christian Clason
1b5a394ffd vim-patch:011f222: runtime(thrift): add ftplugin, indent and syntax scripts
Problem: Apache Thrift files misses ftplugin, indent and syntax scripts

Solution:
- add ftplugin and indent scripts
- add thrift indent test
- port the syntax script from apache/thrift (Apache License 2)

Reference:
https://diwakergupta.github.io/thrift-missing-guide/#_language_reference

closes: vim/vim#15387

011f2223e5

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-07-30 10:39:43 +02:00
zeertzjq
0af056ebce vim-patch:49cdd62: runtime(doc): list of new/changed features in version9.txt
closes: vim/vim#13753

49cdd629a3

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-07-30 12:18:44 +08:00
Riley Bruins
94d42a3e72 fix(treesitter): highlight anonymous nodes in inspect_tree
**Problem:** With anonymous nodes toggled in the inspect tree, only
named nodes will be highlighted when moving the cursor in the source
code buffer.

**Solution:** Retrieve the anonymous node at the cursor (when toggled on
in the inspect tree) and highlight them when appropriate, for better
clarity/specificity.
2024-07-29 17:15:46 +02:00
Riley Bruins
1af55bfcf2 feat(treesitter): allow get_node to return anonymous nodes
Adds a new field `include_anonymous` to the `get_node` options to allow
anonymous nodes to be returned.
2024-07-29 17:15:46 +02:00
Riley Bruins
bd3b6ec836 feat(treesitter): add node_for_range function
This is identical to `named_node_for_range` except that it includes
anonymous nodes. This maintains consistency in the API because we
already have `descendant_for_range` and `named_descendant_for_range`.
2024-07-29 17:15:46 +02:00
Christian Clason
01a56a056c vim-patch:9.1.0636: filetype: ziggy files are not recognized
Problem:  filetype: ziggy files are not recognized
Solution: detect '*.ziggy' files as ziggy filetype,
          detect '*.ziggy-schema' files as ziggy-schema filetype
          (EliSauder)

References: https://ziggy-lang.io/

fixes: vim/vim#15355
closes: vim/vim#15367

f4572cee35

Co-authored-by: EliSauder <24995216+EliSauder@users.noreply.github.com>
2024-07-29 09:12:14 +02:00
Christian Clason
e596b6a18d vim-patch:9.1.0635: filetype: SuperHTML template files not recognized
Problem:  filetype: SuperHTML template files not recognized
Solution: Update the filetype detection code to detect '*.shtml' either
          as HTML (Server Side Includes) or SuperHTML (template files)
          (EliSauder)

related: vim/vim#15355
related: vim/vim#15367

e57c9a19ed

Co-authored-by: EliSauder <24995216+EliSauder@users.noreply.github.com>
2024-07-29 09:12:14 +02:00
Christian Clason
8168b228e0 vim-patch:4c45425: runtime(debcopyright): Add support for Files-Included in syntax script
Full support (including for components) was finished with this commit:
ee90dad771

closes: vim/vim#15374

4c45425c10

Co-authored-by: josch <josch@debian.org>
2024-07-29 09:12:03 +02:00
zeertzjq
fe5030c05e
vim-patch:partial:52e7cc2: runtime(doc): tweak documentation style a bit (#29897)
closes: vim/vim#15371

52e7cc26d8

Co-authored-by: h-east <h.east.727@gmail.com>
2024-07-29 00:02:31 +00:00
Christian Clason
5aa1a9532c docs(treesitter): don't quote metadata 2024-07-28 16:13:11 +02:00
Christian Clason
9e80738f30 fix(runtime): sync bundled treesitter queries 2024-07-28 16:13:11 +02:00
Mathias Fußenegger
bdff50dee5
fix(lsp): revert text edit application order change (#29877)
Reverts https://github.com/neovim/neovim/pull/29212 and adds a few
additional test cases

From the spec

> All text edits ranges refer to positions in the document they are
> computed on. They therefore move a document from state S1 to S2 without
> describing any intermediate state. Text edits ranges must never overlap,
> that means no part of the original document must be manipulated by more
> than one edit. However, it is possible that multiple edits have the same
> start position: multiple inserts, or any number of inserts followed by a
> single remove or replace edit. If multiple inserts have the same
> position, the order in the array defines the order in which the inserted
> strings appear in the resulting text.

The previous fix seems wrong. The important part:

> If multiple inserts have the same position, the order in the array
> defines the order in which the inserted strings appear in the
> resulting text.

Emphasis on _appear in the resulting text_

Which means that in:

    local edits1 = {
      make_edit(0, 3, 0, 3, { 'World' }),
      make_edit(0, 3, 0, 3, { 'Hello' }),
    }

`World` must appear before `Hello` in the final text. That means the old
logic was correct, and the fix was wrong.
2024-07-27 22:30:14 +02:00
zeertzjq
aee4254b76
Merge pull request #29876 from glepnir/vim-patch
vim-patch:9.1.{0618,0619,0629}: cannot mark deprecated attributes in completion menu
2024-07-27 22:12:30 +08:00
zeertzjq
b8b0e9db3f vim-patch:9.1.0629: Rename of pum hl_group is incomplete
Problem:  Rename of pum hl_group is incomplete in source.
Solution: Also rename the test function.  Rename to user_hlattr in code
          to avoid confusion with pum_extra.  Add test with matched text
          highlighting (zeertzjq).

closes: vim/vim#15348

4100852e09
2024-07-27 21:56:44 +08:00
Maria José Solano
8bdfc2ab2b fix(version): return nil with empty string 2024-07-27 14:06:31 +01:00
glepnir
f132f8e9d4 vim-patch:9.1.0618: cannot mark deprecated attributes in completion menu
Problem:  cannot mark deprecated attributes in completion menu
Solution: add hl_group to the Dictionary of supported completion fields
          (glepnir)

closes: vim/vim#15314

508e7856ec

Co-authored-by: glepnir <glephunter@gmail.com>
2024-07-27 18:05:37 +08:00
zeertzjq
60967cd9aa
vim-patch:9.1.0616: filetype: Make syntax highlighting off for MS Makefiles (#29874)
Problem:  filetype: Make syntax highlighting off for MS Makefiles
Solution: Try to detect MS Makefiles and adjust syntax rules to it.
          (Ken Takata)

Highlighting of variable expansion in Microsoft Makefile can be broken.
E.g.:
2979cfc262/src/Make_mvc.mak (L1331)

Don't use backslash as escape characters if `make_microsoft` is set.
Also fix that `make_no_comments` was not considered if `make_microsoft`
was set.

Also add description for `make_microsoft` and `make_no_comments` to the
documentation and include a very simple filetype test

closes: vim/vim#15341

eb4b903c9b

Co-authored-by: Ken Takata <kentkt@csc.jp>
2024-07-27 16:48:29 +08:00
Christian Clason
aa853f362a vim-patch:a7295ae: runtime(autohotkey): include initial filetype plugin
closes: vim/vim#15345

a7295ae7f5

Co-authored-by: Peter Aronoff <peter@aronoff.org>
2024-07-27 01:12:09 +02:00
Christian Clason
bb185d63ab vim-patch:4d68054: runtime(progress): Add single-line comment syntax
Progress OpenEdge 11.6 added a new C-like single-line comment syntax; such
comments begin with `//` and proceed to the end of the line.

Add a new syntax group `ProgressLineComment` to implement highlighting for this
syntax. Rename the existing group from `ProgressComment` to
`ProgressBlockComment`, and introduce a cluster named `ProgressComment` to
encapsulate both.

closes: vim/vim#15339

4d68054c1e

Co-authored-by: Daniel Smith <daniel@rdnlsmith.com>
2024-07-26 08:45:06 +02:00
Christian Clason
a2840d0117 vim-patch:d5cc8ee: runtime(progress): Update maintainer info
The Progress syntax file was last updated eight years ago, and the header
information twelve years ago. Attempts to contact the last known maintainer at
the email address listed in the file header (with the spam-prevention characters
removed) produced a delivery failure notification stating that the address did
not exist.

I intend to submit some minor improvements to this file. Per [1], I will assume
maintainership of it for the time being.

related: vim/vim#15339

[1]: https://groups.google.com/g/vim_dev/c/I3pOKIOgM4A/m/pekGQB_lBwAJ

d5cc8ee0fa

Co-authored-by: Daniel Smith <daniel@rdnlsmith.com>
2024-07-26 08:45:06 +02:00
Carman Fu
41b70a0dea
fix(runtime): set 'keywordprg' only once in vim ftplugin 2024-07-26 08:45:51 +08:00
Christian Clason
807eb4434c vim-patch:9.1.0612: filetype: deno.lock file not recognized
Problem:  filetype: deno.lock file not recognized
Solution: detect 'deno.lock' as json filetype
          (カワリミ人形)

Reference:
https://docs.deno.com/runtime/manual/basics/modules/integrity_checking/#caching-and-lock-files

closes: vim/vim#15333

df77c8ad39

Co-authored-by: カワリミ人形 <kawarimidoll+git@gmail.com>
2024-07-25 10:01:46 +02:00
Christian Clason
108d2bf74b vim-patch:e73e5b8: runtime(java): Optionally highlight the :: token for method references
This token will be highlighted, similar to the arrow of
lambda expressions, whenever "g:java_highlight_functions" is
defined.

Also:

- Improve the recognition of _switch-case_ labels
  (D-Cysteine).
- Remove insignificant empty statements in syntax test
  files.

closes: vim/vim#15322

References:
https://docs.oracle.com/javase/specs/jls/se21/html/jls-15.html#jls-15.13
https://github.com/fleiner/vim/pull/1

e73e5b889b

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
Co-authored-by: D-Cysteine <54219287+D-Cysteine@users.noreply.github.com>
2024-07-25 10:01:35 +02:00
Christian Clason
90d40c68dc vim-patch:2cad941: runtime(zip): Use delete() for deleting directory
This is safer because we don't invoke the shell.

closes: vim/vim#15335

2cad941dc0

Co-authored-by: Damien <141588647+xrandomname@users.noreply.github.com>
2024-07-25 10:01:35 +02:00
zeertzjq
0cdeb06db0
vim-patch:ddbb6fe: runtime(vim): Update base-syntax, improve :set highlighting (#29850)
- Match bang, "all" and "termcap" options, and trailing command
  separator "|".
- Highlight set assignment operators.
- Match multiline :set and multiline option values.
- Mention the newer "0o" octal prefix at :help :set=.

closes: vim/vim#15329

ddbb6fe2d0

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-07-25 09:55:59 +08:00
Abao Zhang
b4b4cf46a7 fix(health): fix pyenv root and python exepath detect issue
Fix the following two issues:

- pyenv root detection issue

When `PYENV_ROOT` environment variable is not set, neovim will detect
pyenv's root via `pyenv root` command, but which will be always fail
because `vim.fn.system()` returns result with additional `\n`. Using
`vim.system` instead prevents this problem. to trim it before check
whether it is exists

- python executable path detection issue

Filter unrelated `python-config` in cases where multiple python versions
are installed, e.g. `python-config`, `python3.10-config`,
`python3.11-config` etc.
2024-07-24 16:21:46 +02:00
Christian Clason
862338255d fix(runtime): sync bundled treesitter queries 2024-07-24 16:02:53 +02:00
Christian Clason
64727ac012 vim-patch:38ce71c: runtime(zip): correctly extract file from zip browser
Problem:  Enter 'x' in zip browser fail with E121
Solution: Fix typo in zip#Extract()

closes: vim/vim#15321

38ce71c1c3

Co-authored-by: Damien <141588647+xrandomname@users.noreply.github.com>
2024-07-24 09:14:26 +02:00
Nikita Rudakov
c025c049a4
vim-patch:581d4a7: runtime(netrw): escape filename before trying to delete it (#29838)
fixes: vim/vim#15330

581d4a7b35

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-24 07:33:44 +08:00
Christian Clason
9322b7e059 vim-patch:9d57ea5: runtime(netrw): Fix endless recursion in netrw#Explore()
Problem:  ':E /etc BOOM' give E132 error.
Solution: Avoid recursion call with same arguments.

fixes: vim/vim#5723
closes: vim/vim#15318

9d57ea5cd3

Co-authored-by: Damien <141588647+xrandomname@users.noreply.github.com>
2024-07-23 00:30:30 +02:00
Gregory Anders
79d492a421
vim-patch:9.1.0610: filetype: OpenGL Shading Language files are not detected (#29831)
Problem:  filetype: OpenGL Shading Language files are not detected
Solution: detect various file extensions as GLSL filetype, include
          indent and syntax script, do no longer recognize '*.comp'
          as Mason filetype (Gregory Anders)

closes: vim/vim#15317

e4b991ed36
2024-07-23 06:28:05 +08:00
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