Commit Graph

28502 Commits

Author SHA1 Message Date
Christian Clason
0da18ae5ce vim-patch:c46c21b4ca47
runtime(netrw): fixing remote file removal via ssh (vim/vim#13942)

Make pattern, which retrieves the path component from e.g.
`scp://user@host//opt/program/file.ext` non-greedy.

c46c21b4ca

Co-authored-by: MiguelBarro <45819833+MiguelBarro@users.noreply.github.com>
2024-02-01 10:04:32 +01:00
Christian Clason
e0961aaa5a vim-patch:83f627ff42a3
runtime(racket): add missing space to b:undo_indent var (vim/vim#13945)

This copies commit 2a4862a (fixup! indent: only reset some options when
has vim9, 2024-01-31) from https://github.com/benknoble/vim-racket and
fixes 26b0176a9 (runtime(racket): undo some indent options only when
vim9script is available (vim/vim#13935), 2024-01-30).

83f627ff42

Co-authored-by: D. Ben Knoble <ben.knoble+github@gmail.com>
2024-02-01 10:04:32 +01:00
Christian Clason
20f97af417 build(deps): bump luajit to HEAD - 9cc2e42b1 2024-02-01 09:31:36 +01:00
Will Hopkins
6bba4beced
feat(api): make nvim_open_win support non-floating windows (#25550)
Adds support to `nvim_open_win` and `nvim_win_set_config` for creating
and manipulating split (non-floating) windows.
2024-02-01 11:43:35 +08:00
zeertzjq
8fa67fdae5
vim-patch:8.2.0085: dead code in builtin functions (#27281)
Problem:    Dead code in builtin functions.
Solution:   Clean up the code.

3d8a513b46

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-02-01 09:39:48 +08:00
zeertzjq
68c1b1c45a
vim-patch:8.2.0117: crash when using gettabwinvar() with invalid arguments (#27280)
Problem:    Crash when using gettabwinvar() with invalid arguments. (Yilin
            Yang)
Solution:   Use "curtab" if "tp" is NULL. (closes vim/vim#5475)

ee93b737aa

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-02-01 09:26:19 +08:00
zeertzjq
0a8e66898d
build: update builtin terminfo (#27272)
- Update to ncurses 6.4.20230520
- Disable smglp and smgrp for vtpcon and conemu
- Add xterm+sl to vtpcon, fix #26880
2024-01-31 21:45:30 +08:00
Christian Clason
f4b3636f24 vim-patch:bdb9d9afba97
runtime(netrw): Use :exec norm! <leftmouse> before :call mapping in netrw (vim/vim#12180)

fixes: vim/vim#12143

bdb9d9afba

Co-authored-by: user202729 <25191436+user202729@users.noreply.github.com>
2024-01-31 09:55:08 +01:00
Christian Clason
6e8e3a2a3a vim-patch:26b0176a98f8
runtime(racket): undo some indent options only when vim9script is available (vim/vim#13935)

This copies commit 64edf95 (indent: only reset some options when has
vim9, 2024-01-30) from https://github.com/benknoble/vim-racket.

26b0176a98

Co-authored-by: D. Ben Knoble <ben.knoble+github@gmail.com>
2024-01-31 09:55:08 +01:00
zeertzjq
9f15a18fa5
fix(statusline): missing offset when showing 'keymap' (#27270) 2024-01-31 08:48:52 +08:00
zeertzjq
4ffc20c951
fix(lua): avoid internal error when :luado deletes lines (#27262) 2024-01-30 08:09:25 +08:00
zeertzjq
a2070ba877
vim-patch:9.1.0065: Segfault with CompleteChanged autocommand (#27261)
Problem:  Segfault with CompleteChanged autocommand
          (markonm )
Solution: Test match->cp_prev for being NULL before accessing it

closes: vim/vim#13929

fef6630166

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-30 07:34:37 +08:00
Jongwook Choi
be5cf33836
fix(gen_help_html): type warnings, spell_ignore_files #27254
- Add type annotations, fix most of the type warnings.
- Fix a minor bug on `spell_ignore_files`: nil error when an invalid
  spelling is found but the file is not ignored.
2024-01-29 11:02:10 -08:00
Justin M. Keyes
a060c13f55
Merge #27246 from justinmk/health 2024-01-29 09:43:49 -08:00
dundargoc
758504ec73 docs: document special labels used in CI 2024-01-29 13:46:04 +01:00
Evgeni Chasnovski
4f788f78f8
vim-patch:9.1.0061: UX of visual highlighting can be improved (#27256)
Problem:  UX of visual highlighting can be improved
Solution: Improve readibility of visual highlighting,
          by setting better foreground and background
          colors

The default visual highlighting currently is nice in that it overlays
the actual syntax highlighting by using a separate distinct background
color.

However, this can cause hard to read text, because the contrast
between the actual syntax element and the background color is way too
low. That is an issue, that has been bothering colorschemes authors for
quite some time so much, that they are defining the Visual highlighting
group to use a separate foreground and background color, so that the
syntax highlighting vanishes, but the text remains readable (ref:
vim/colorschemesvim/vim#250)

So this is an attempt to perform the same fix for the default Visual
highlighting and just use a default foreground and background color
instead of using reverse.

I also removed the hard-coded changes to the Visual highlighting in
init_highlight. It's not quite clear to me, why those were there and not
added directly to the highlighting_init_<dark|light> struct.

closes: vim/vim#13663
related: vim/colorschemes#250

e6d8b4662d

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-29 18:39:57 +08:00
Will Hopkins
ca9f6f5694
feat(api): add nvim_tabpage_set_win (#27222)
Allows setting the current window of a non-current tabpage
without switching tabpages.
2024-01-29 15:18:33 +08:00
zeertzjq
5e5b004da4 vim-patch:cf8695d48cdd
runtime(vim): Highlight string interpolation

closes: vim/vim#13923

cf8695d48c

Co-authored-by: thinca <thinca@gmail.com>
2024-01-29 11:25:35 +08:00
zeertzjq
7db83d47b2 vim-patch:21ce159e0561
runtime(vim): Update syntax and ftplugin files (vim/vim#13924)

Improve matching of line-continuations and interspersed comments.

These are now also matched in multiline syntax command patterns,
dictionary literals, and parenthesised expressions and argument lists.

21ce159e05

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-01-29 11:25:35 +08:00
zeertzjq
d62b3fa623 vim-patch:c79646dfb101
runtime(vim): Update syntax file (vim/vim#13671)

Support multiline :syntax commands.

Match :syn-cchar option in :syn-{keyword,region}.

c79646dfb1

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-01-29 11:25:35 +08:00
zeertzjq
f1e51528d2 vim-patch:71b6d3397649
Update runtime files

71b6d33976

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-01-29 11:25:35 +08:00
Gregory Anders
15e77a56b7
feat(extmarks): subpriorities (relative to declaration order) (#27131)
The "priority" field of extmarks can be used to set priorities of
extmarks which dictates which highlight group a range will actually have
when there are multiple extmarks applied. However, when multiple
extmarks have the same priority, the only way to enforce an actual
priority is through the order in which the extmarks are set.

It is not always possible or desirable to set extmarks in a specific
order, however, so we add a new "subpriority" field that explicitly
enforces the ordering of extmarks that have the same priority.

For now this will be used only to enforce priority of treesitter
highlights. A single node in a treesitter tree may match multiple
captures, in which case that node will have multiple extmarks set. The
order in which captures are returned from the treesitter API is not
_necessarily_ in the same order they are defined in a query file, so we
use the new subpriority field to force that ordering.

For now subpriorites are not documented and are not meant to be used by
external code, and it only applies to ephemeral extmarks. We indicate
the "private" nature of subpriorities by prefixing the field name with
an "_".
2024-01-28 21:13:58 -06:00
vE5li
af6537bc66
fix(jumplist): Ctrl+o, Ctrl+i weird behavior when deleting buffers #25461
Problem:
- Navigation is not always symmetric: pressing Ctrl+o n times followed
  by Ctrl+i n times does not always gets me back to where I started.
- Invalid buffers are not skipped by Ctrl+i/o, I have to press Ctrl+i/o
  multiple times to get to the next/previous buffer.

Solution:
- Remove all entries of a buffer from the jump list when deleting it.
- Don't add a new entry to the jump list if the next buffer to be
  displayed is already in the jump list.

Closes #25365
2024-01-28 19:08:51 -08:00
Maria José Solano
eee52d3427
refactor(lsp): client_hints typo #27250 2024-01-28 18:38:36 -08:00
zeertzjq
d6f7fa14c5
refactor(window.c): add a few more assertions (#27249) 2024-01-29 10:05:33 +08:00
Jongwook Choi
5b1b765610
docs: enforce "treesitter" spelling #27110
It's the "tree-sitter" project, but "treesitter" in our code and docs.
2024-01-28 17:53:14 -08:00
zeertzjq
b0e85010fe
test: more tests for nvim_tabpage_get_win (#27248) 2024-01-29 08:32:24 +08:00
zeertzjq
ba7a52dedc
vim-patch:9.1.0060: Recorded register cannot be translated using keytrans() (#27247)
Problem:  Recorded register cannot be translated using keytrans() when
          it involves character search (iddqd505)
Solution: Record a K_IGNORE instead of a K_NOP (zeertzjq)

related: vim/vim#13916
closes: vim/vim#13925

bf321806bf
2024-01-29 07:27:15 +08:00
Justin M. Keyes
56ae85a33c
docs: .git-blame-ignore-revs #26397 2024-01-28 15:03:10 -08:00
Justin M. Keyes
e39b6d0c52 fix(health): "attempt to concatenate nil"
Problem:
If `neovim` module is not installed, python and ruby healthchecks fail:

    - ERROR Failed to run healthcheck for "provider.python" plugin. Exception:
      .../runtime/lua/provider/python/health.lua:348: attempt to concatenate local 'pyname' (a nil value)
    - ERROR Failed to run healthcheck for "provider.ruby" plugin. Exception:
      .../runtime/lua/provider/ruby/health.lua:25: attempt to index local 'host' (a nil value)

Solution:
Check for non-nil.
2024-01-28 23:56:06 +01:00
Justin M. Keyes
50cd5ed360 fix(health): check more "old" files 2024-01-28 23:56:03 +01:00
Justin M. Keyes
4ddd999f65
docs: update FAQ URLs #27236 2024-01-28 14:53:05 -08:00
Jongwook Choi
095f731af0
docs: include backtrace for bug-crash #27065
Github Issue template:

- Add pointers to |dev-tools-backtrace|.
- Add pointers to CONTRIBUTING.md (Reporting Problems), which includes
  additional helpful instructions for issue reporting.
- Search existing issues: include label `bug-crash` as well as `bug`.

CONTRIBUTING.md:

- Fix broken link on "stacktrace" after moving to help from wiki.
2024-01-28 14:26:13 -08:00
Jongwook Choi
01e82eba20
build(docs): separate lint job to validate vimdoc #27227
Summary: Separate the lint job (`make lintdoc`) to validate runtime/doc,
it is no longer as a part of functionaltest (help_spec).

Build (cmake) and CI:

- `make lintdoc`: validate vimdoc files and test-generate HTML docs.
  CI will run this as a part of the "docs" workflow.

- `scripts/lintdoc.lua` is added as an entry point (executable script)
  for validating vimdoc files.

scripts/gen_help_html.lua:

- Move the tests for validating docs and generating HTMLs from
  `help_spec.lua` to `gen_help_html`. Added:
  - `gen_help_html.run_validate()`.
  - `gen_help_html.test_gen()`.

- Do not hard-code `help_dir` to `build/runtime/doc`, but resolve from
  `$VIMRUNTIME`. Therefore, the `make lintdoc` job will check doc files
  on `./runtime/doc`, not on `./build/runtime/doc`.

- Add type annotations for gen_help_html.
2024-01-28 14:22:39 -08:00
Gregory Anders
47cd532bf1
docs: explain why TUI is reinitialized on resume (#27177) 2024-01-28 08:38:59 -06:00
zeertzjq
1bc7e18aa8
test(lua/snippet_spec): wait for completion menu (#27243)
This fixes the flakiness caused by typing a completion menu key when the
completion menu hasn't showed up.
2024-01-28 22:01:25 +08:00
Gregory Anders
6d86a6fe44
test(tui): add & improve tests for terminal queries (#27219)
Problems:

1. The test case for querying truecolor support did not check which
   capabilities were queried
2. The test case for querying truecolor support checked `&termguicolors`
   in the Nvim test runner, not the child Nvim in the the embedded
   terminal
3. The test case for querying truecolor support did not actually respond
   to the XTGETTCAP requests. `'termguicolors'` is still enabled even
   without responding to this query because libvterm understands and
   responds to the DECRQSS request, but it is still good to respond to
   the query explicitly instead of depending on hidden libvterm behavior
4. No test case exists at all for OSC 52

Solution:

Fix all of the problems listed above.
2024-01-28 07:37:57 -06:00
Sean Dewar
a757195a60
Merge pull request #24704 from seandewar/cmdwin-madness
vim-patch:9.1.{0047,0048,0049}: fun cmdwin fixes
2024-01-28 13:03:56 +00:00
Sean Dewar
d85f180f26
vim-patch:9.1.0049: Make "[Command Line]" a special buffer name
Problem:  E95 is possible if a buffer called "[Command Line]" already
          exists when opening the cmdwin. This can also happen if the
          cmdwin's buffer could not be deleted when closing.

Solution: Un-name the cmdwin buffer, and give it a special name instead,
          similar to what's done for quickfix buffers and for unnamed
          prompt and scratch buffers. As a result, BufFilePre/Post are
          no longer fired when opening the cmdwin. Add a "command" key
          to the dictionary returned by getbufinfo() to differentiate
          the cmdwin buffer instead. (Sean Dewar)

Cherry-pick test_normal changes from v9.0.0954.

1fb4103206
2024-01-28 12:29:42 +00:00
Sean Dewar
7bb0dd08db
vim-patch:9.1.0048: Abort opening cmdwin if autocmds screw things up
Problem:  Autocmds triggered from opening the cmdwin (in win_split and
          do_ecmd) can cause issues such as E199, as the current checks
          are insufficient.

Solution: Commands executed from the cmdwin apply to the old curwin/buf,
          so they should be kept in a "suspended" state; abort if
          they've changed. Also abort if cmdwin/buf was tampered with,
          and check that curwin is correct. Try to clean up the cmdwin
          buffer (only if hidden and non-current to simplify things; the
          same approach is used when closing cmdwin normally), and add a
          beep. (Sean Dewar)

Rename the old Test_cmdwin_interrupted() like in the patch (can be moved to
test_cmdwin.vim when v9.0.0027 is ported).
Move the error message to `e_active_window_or_buffer_changed_or_deleted`.

43b395ec2e
2024-01-28 12:29:42 +00:00
Sean Dewar
cf140fb25b
vim-patch:9.1.0047: issues with temp curwin/buf while cmdwin is open
Problem:  Things that temporarily change/restore curwin/buf (e.g:
          win_execute, some autocmds) may break assumptions that
          curwin/buf is the cmdwin when "cmdwin_type != 0", causing
          issues.

Solution: Expose the cmdwin's real win/buf and check that instead. Also
          try to ensure these variables are NULL if "cmdwin_type == 0",
          allowing them to be used directly in most cases without
          checking cmdwin_type. (Sean Dewar)

Reset and save `cmdwin_old_curwin` in a similar fashion.
Apply suitable changes for API functions and add Lua tests.

988f74311c
2024-01-28 12:29:26 +00:00
zeertzjq
74e695d227
Merge pull request #27221 from BugLight/fix-coverity-found-bugs
Fix bugs found by coverity
2024-01-28 13:33:38 +08:00
Daniil Zhukov
9d48266bed fix(coverity/471380): null dereference in get_local_additions()
strrchr returns null pointer if '.' is not present in file name. Notice
that filenames are filtered to match "doc/*.??[tx]" pattern earlier so
we shouldn't expect null pointer here. However later in code strrchr
return value is checked so it seems better and more consistent to do the
same here too.
2024-01-27 23:00:24 +04:00
Justin M. Keyes
2cd76a758b
docs(lua): update ":{range}lua" docs + error message #27231
- `:lua (no file)` is misleading because `:lua` never takes a file arg,
  unlike `:source`.
- Update various related docs.
2024-01-27 10:40:30 -08:00
Christian Clason
17b298b7c8 vim-patch:0cc6108fea21
runtime(ant): Update syntax file (vim/vim#13926)

Remove invalid display option from syn-keyword commands.

Take over maintenance of this file.

0cc6108fea

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-01-27 19:38:05 +01:00
Gregory Anders
5ca330859c
fix(decor): check decor kind before accessing union field (#27205)
The data.sh.url field is valid only when item.kind is
kDecorKindHighlight. The `if` block just before this line already does
that check (as well as checking `active`) so move the access of
`data.sh.url` into that block.
2024-01-27 08:26:01 -06:00
Christian Clason
e35ae6fbc2 vim-patch:772f8f542513
runtime(hurl): add hurl filetype plugin(vim/vim#13921)

772f8f5425

Co-authored-by: Melker Ulander <melker.ulander@pm.me>
2024-01-27 12:02:59 +01:00
zeertzjq
bf9e92c81c
fix(events): check for WinResized/WinScrolled in terminal mode (#27226) 2024-01-27 15:18:41 +08:00
zeertzjq
7367838359
fix(api): limit depth of nvim_cmd (#27225) 2024-01-27 14:03:44 +08:00
zeertzjq
38bb0e1da8
test(tui_spec): get &background from child session directly (#27224) 2024-01-27 12:42:32 +08:00