Commit Graph

29399 Commits

Author SHA1 Message Date
Fred Sundvik
b400b947f3 fix: prevent child processes from inheriting ui channel file descriptors 2024-04-02 22:15:34 +03:00
bfredl
fa74f75710 refactor(tests): allow to extend the new base set of attrs
We start at 100 so we can make the base set larger if needed. (It might need to
grow/shrink as a result of adopting the new default color scheme as the
default for tests)

Usage best illustrataded by example.

Improving the workflow for making new tests with `screen:snapshot_util()` will
be a follow up.
2024-04-02 20:28:27 +02:00
Lewis Russell
d9235efa76 refactor(lsp): move workspace folder logic into the client
- Changed `reuse_client` to check workspace folders in addition to
  root_dir.
2024-04-02 16:47:17 +01:00
dundargoc
ffe3002568 test: silence expected errors
This will remove unrelated errors in .nvimlog at the end of test output.
2024-04-02 17:07:44 +02:00
Christian Clason
6cfca21bac feat(treesitter): add @injection.filename
Problem: Injecting languages for file redirects (e.g., in bash) is not
possible.

Solution: Add `@injection.filename` capture that is piped through
`vim.filetype.match({ filename = node_text })`; the resulting filetype
(if not `nil`) is then resolved as a language (either directly or
through the list maintained via `vim.treesitter.language.register()`).

Note: `@injection.filename` is a non-standard capture introduced by
Helix; having two editors implement it makes it likely to be upstreamed.
2024-04-02 11:13:16 +02:00
Will Hopkins
b3f9da9524
refactor: informative error msg for 'noautocmd' (#28147)
Problem: Attempting to set 'noautocmd' for an existing window throws an error
that just says "Invalid key: 'noautocmd'" which is not very helpful.
Solution: Explain that 'noautocmd' can't be used with existing windows.
2024-04-02 12:48:21 +08:00
Christian Clason
feaab21c71 vim-patch:cc7597c1edf4
runtime(yaml): improve syntax highlighting for YAML

- Recognize block scalar style to avoid unexpected highlighting by `yamlFlowString` (fix vim/vim#11517)
- Improve performance of `yamlFlowMappingKey` by allowing execution by the NFA engine (fix vim/vim#10730)
  - It was intentionally disabled before patterns were optimized by `s:SimplifyToAssumeAllPrintable`.
- Fix detection of flow style mapping indicators (fix vim/vim#8234).
- Enable highlighting of explicit mapping value indicators and node properties in flow style.
- Add syntax highlighting tests

closes: vim/vim#14354

cc7597c1ed

Co-authored-by: itchyny <itchyny@cybozu.co.jp>
2024-04-01 15:52:26 +02:00
zeertzjq
4a6b4b00cb
vim-patch:9.1.0251: Filetype test fails (#28142)
Problem:  Filetype test fails.
Solution: Move detection by name before detection by extension.
          Improve TextChanged test and remove wrong test and fix
          a typo in a comment (zeertzjq).

closes: vim/vim#14373

8eb7523802

The changes to filetype.vim are N/A since Nvim always prefers filename
matches to extension matches.
2024-04-01 21:49:44 +08:00
zeertzjq
381806729d
vim-patch:9.0.1643: filetype detection fails if file name ends in many '~' (#28141)
Problem:    Filetype detection fails if file name ends in many '~'.
Solution:   Strip multiple '~' at the same time. (closes vim/vim#12553)

c12e4eecbb

In Nvim this already works as Lua filetype detection isn't subject to
such a small recursion limit as autocommands, but it still makes sense
to avoid unnecessary recursion.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-04-01 18:43:30 +08:00
Christian Clason
2e97ae2664 vim-patch:9.1.0250: filetype: ldscripts cannot be recognized
Problem:  filetype: ldscripts cannot be recognized
Solution: Detect '*/ldscripts/*' as ld
          (Wu, Zhenyu)

closes: vim/vim#14371

4c7098b00a

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
000431820e vim-patch:9.1.0249: filetype: rock_manifest and config.ld files are not recognized
Problem:  filetype: rock_manifest and config.ld files are not recognized
Solution: Detect 'rock_manifest' and 'config.ld' as lua
          (Wu, Zhenyu)

closes: vim/vim#14370

a917bd58bd

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
19ee281809 vim-patch:9.1.0248: filetype: yarn lock files are not recognized
Problem:  filetype: yarn lock files are not recognized
Solution: Detect 'yarn.lock' files as yaml
          (Wu, Zhenyu)

closes: vim/vim#14369

3b497aa247

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
de1a54dfe1 vim-patch:9.1.0247: filetype: bundle config files are not recognized
Problem:  filetype: bundle config files are not recognized
Solution: Detect '*/.bundle/config' as yaml
          (Wu, Zhenyu)

closes: vim/vim#14368

3f6fa93b3b

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
09869c3745 vim-patch:9.1.0246: filetype: fontconfig files are not recognized
Problem:  filetype: fontconfig files are not recognized
Solution: detect 'fonts.conf' as xml
          (Wu, Zhenyu)

closes: vim/vim#14367

a2c27b01dc

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
fa863c17b2 vim-patch:9.1.0245: filetype: zsh theme, history and zunit files are not recognized
Problem:  filetype: zsh theme, history and zunit files are not
          recognized.
Solution: Detect '.zsh_history', '*.zsh-theme' and '*.zunit' as zsh
          (Wu, Zhenyu)

closes: vim/vim#14366

a55a22a1a3

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
239101e32a vim-patch:9.1.0244: filetype: bash history files are not recognized
Problem:  filetype: bash history files are not recognized
Solution: detect .bash-history and .bash_history files as bash
          (Wu, Zhenyu)

closes: vim/vim#14365

84ce55001a

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
1a0b27965c vim-patch:9.1.0243: filetype: netrw history file is not recognized
Problem:  filetype: netrw history file is not recognized
Solution: Detect .netrwhist as vim files (Wu, Zhenyu)

closes: vim/vim#14364

abbb4a4f70

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
5cdbb22c34 vim-patch:9.1.0242: filetype: octave history files are not recognized
Problem:  filetype: octave history files are not recognized
Solution: Detect octave/history files as octave
          (Wu, Zhenyu)

closes: vim/vim#14363

be71ac694f

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
afc7a5611e vim-patch:9.1.0241: filetype: mysql history files are not recognized
Problem:  filetype: mysql history files are not recognized
Solution: Detect .mysql_history as mysql
          (Wu, Zhenyu)

closes: vim/vim#14362

6b285c8cfd

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
a978e83158 vim-patch:9.1.0240: filetype: some python tools config files are not recognized
Problem:  filetype: some python tools config files are not recognized
Solution: Detect config files for setuptools, pudb, coverage as dosini
          (Wu, Zhenyu)

closes: vim/vim#14361

665220a17b

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
acac56360f vim-patch:9.1.0239: filetype: gnuplot history files are not recognised
Problem:  filetype: gnuplot history files are not recognised
Solution: detect .gnuplot_history files as gnuplot
          (Wu, Zhenyu)

closes: vim/vim#14360

8e47eb31cc

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
ce69056e95 vim-patch:9.1.0238: filetype: jupyterlab and sublime config are not recognized
Problem:  filetype: jupyterlab and sublime config are not recognized
Solution: Detect jupyterlab and sublime config files as json
          (Wu, Zhenyu)

closes: vim/vim#14359

75c607dff7

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
f29ba3c46c vim-patch:9.1.0237: filetype: mplstyle files are not recognized
Problem:  filetype: mplstyle files are not recognized
Solution: Detect '*.mplstyle' files as yaml (Wu, Zhenyu)

closes: vim/vim#14358

0fd560d46a

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
2e0233d003 vim-patch:9.1.0236: filetype: texlua files are not recognized
Problem:  filetype: texlua files are not recognized
Solution: Add '*.tlu' pattern for texlua files (Wu, Zhenyu)

Reference: https://github.com/TeX-Live/texdoc/tree/master/script

closes: vim/vim#14357

a75f4791b1

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
96d77b2051 vim-patch:9.1.0235: filetype: supertux files are not recognized
Problem:  filetype: supertux files are not recognized
Solution: Supertux uses lisp to store hotkeys in config and game stage information,
          so add a pattern for supertux files.
          (Wu, Zhenyu)

Reference: https://github.com/SuperTux/supertux/wiki/S-Expression

closes: vim/vim#14356

4ff83b904e

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
c24dcb1bea vim-patch:9.1.0234: filetype: support for Intel HEX files is lacking
Problem:  filetype: support for Intel HEX files is lacking
Solution: Add more file extensions that are typical for Intel HEX files
          (Wu, Zhenyu)

Reference: https://en.wikipedia.org/wiki/Intel_HEX

closes: vim/vim#14355

e523dd9803

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
zeertzjq
b8858dddbf
Merge pull request #28080 from echasnovski/intro-buf-change
fix(intro): link showing intro to state at start
2024-04-01 08:02:42 +08:00
Christian Clason
6b9a808d13 vim-patch:18d730d7b572
runtime(compilers): ensure compiler! sets global options (vim/vim#14336)

Previously some options were only set locally by
&l:makeprg/errorformat

This suffices for :compiler (without a trailing bang)
but falls short for :compiler! that sets &g:makeprg/errorformat as
well

Also apply kind suggestions by @dkearns and @lifepillar

18d730d7b5

omit context.vim (vim9script only)

Co-authored-by: Enno <Konfekt@users.noreply.github.com>
2024-04-01 00:48:30 +02:00
zeertzjq
1570cfb638
test(core/job_spec): skip exit test if "sleep" command missing (#28137) 2024-04-01 06:48:14 +08:00
zeertzjq
c4221df7b5
vim-patch:9.1.0232: Conceal test fails when rightleft feature is disabled (#28134)
Problem:  Conceal test fails when rightleft feature is disabled.
Solution: Skip test if rightleft feature is missing (Julio B).

closes: vim/vim#14342

5df961a1bc

Co-authored-by: Julio B <julio.bacel@gmail.com>
2024-04-01 06:12:47 +08:00
zeertzjq
b08667d4f0
vim-patch:9.1.0231: Filetype may be undetected when SwapExists sets ft in other buf (#28136)
Problem:  Filetype may be undetected when a SwapExists autocommand sets
          filetype in another buffer.
Solution: Make filetype detection state buffer-specific.  Also fix a
          similar problem for 'modified' (zeertzjq).

closes: vim/vim#14344

5bf6c2117f
2024-04-01 06:12:11 +08:00
zeertzjq
e005b8d2eb
vim-patch:9.1.0230: TextChanged autocommand not triggered under some circumstances (#28135)
Problem:  TextChanged autocommand not triggered under some circumstances
          (Sergey Vlasov)
Solution: Trigger TextChanged when TextChangedI has not been triggered

fixes: vim/vim#14332
closes: vim/vim#14339

8603270293

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-01 05:39:52 +08:00
Christian Clason
9b9dab622a vim-patch:807fff135d52
runtime(pamconf): add support for Debian specific @includes

fixes: vim/vim#14335

807fff135d

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-03-31 23:05:38 +02:00
Christian Clason
20dd60f13c vim-patch:cbb92b5ceb6a
runtime(sshconfig,sshdconfig): update syntax (vim/vim#14351)

* fix case insensitivity of Host and Hostname keys
* improve regexps
* add keywords

cbb92b5ceb

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2024-03-31 23:05:20 +02:00
Marcin Szamotulski
01691c5447
fix(lsp): abort callHierarchy on no result (#28102)
The `callHierarchy` function should warn the user when
`textDocument/prepareCallHierarchy` didn't resolve an entity and
return, rather than calling the `callHierarchy/{incoming,outgoing}Calls`
method with an empty object - which is encoded as an empty list (which
doesn't respect language server specification for the
`callHierarchy/incomingCalls` call).
2024-03-31 20:43:34 +02:00
zeertzjq
b25753381c
fix(api): set script context when using nvim_set_hl (#28123) 2024-03-31 20:21:47 +08:00
zeertzjq
e1ff2c51ca
feat(lua): pass keys before mapping to vim.on_key() callback (#28098)
Keys before mapping (i.e. typed keys) are passed as the second argument.
2024-03-31 11:20:05 +08:00
zeertzjq
12240600f5
Merge pull request #28114 from echasnovski/builtin-hl-grey-gray
fix(highlight): add `Nvim{Light,Dark}Gray{1,2,3,4}` colors
2024-03-30 21:41:08 +08:00
Evgeni Chasnovski
66925f14de
fix(highlight): consistently spell "Goldenrod" 2024-03-30 15:18:35 +02:00
Evgeni Chasnovski
837f268093
fix(highlight): add Nvim{Light,Dark}Gray{1,2,3,4} colors 2024-03-30 14:31:46 +02:00
dundargoc
77d3526a3d fix: explain that user should run nvim with -V1 to see more information
It's not obvious for users how to figure out where a mapping is set from
only "Last set from Lua".
2024-03-30 12:32:47 +01:00
zeertzjq
35239e977f
test: use matches(...) instead of ok(string.find(...)) (#28111) 2024-03-30 09:29:21 +08:00
zeertzjq
19d63563e1
fix(extmarks): splice earlier when opening new line (#28108)
Related #26364 #26499 #26501
Fix #28107
2024-03-30 08:05:36 +08:00
dundargoc
2424c3e696 fix: support UNC paths in vim.fs.normalize
Closes https://github.com/neovim/neovim/issues/27068.
2024-03-30 00:51:09 +01:00
James Trew
38e38d1b40
fix(fs): allow backslash characters in unix paths
Backslashes are valid characters in unix style paths.

Fix the conversion of backslashes to forward slashes in several `vim.fs`
functions when not on Windows. On Windows, backslashes will still be converted
to forward slashes.
2024-03-29 17:23:01 +01:00
dundargoc
36acb2a8ec ci: use --break-system-packages on mac when installing pynvim
Python 3.12+ throws an error if you try to install a package in an
externally managed environment. Using `--break-system-packages` is not
recommended for personal use, but for CI it should be fine and is
probably the most straightforward solution.
2024-03-29 17:11:29 +01:00
dundargoc
8424c64498
docs: document setting g:clipboard to v:false (#28085) 2024-03-29 09:43:26 -05:00
zeertzjq
74776dfb2a
fix(terminal): fix duplicate recording with mouse click (#28103) 2024-03-29 22:29:10 +08:00
dundargoc
5a5d26b4ab test: skip flaky tests 2024-03-29 14:27:13 +01:00
luukvbaal
3d554b755b
test(normal): port legacy normal test for page scrolling (#28100) 2024-03-29 21:22:16 +08:00