Commit Graph

24352 Commits

Author SHA1 Message Date
dundargoc
3269902a13
refactor: fix IWYU mapping file and use IWYU (#21802)
Also add the EXITFREE definition to main_lib rather than the nvim target, as the header generation needs the EXITFREE flag to work properly.
2023-01-15 14:16:33 +01:00
bfredl
43feb973e3
Merge pull request #21731 from tk-shirasaka/fix/builtin_popup_on_ext_popupmenu
fix: properly close builtin popup in ext_popupmenu
2023-01-15 13:40:55 +01:00
dundargoc
909abfbd87
ci: deduplicate TEST_FILE environment variable (#21667) 2023-01-15 12:25:28 +01:00
Naru
6f0234a5e5
docs(lua): lua-guide: <Nop> is for rhs of vim.keymap.set(), not lhs (#21814) 2023-01-15 12:08:03 +01:00
zeertzjq
6134c1e8a3
test(fileio_spec): avoid expect_exit() without calling clear() (#21810)
Since before_each() doesn't call clear() in these tests, after_each()
may call expect_exit() without calling clear() if a test is skipped,
causing frequent test failures on Cirrus CI. Close the session instead.
2023-01-15 09:34:21 +08:00
zeertzjq
2f32b19967
vim-patch:8.2.0188: Check commands don't work well with Vim9 script (#21809)
Problem:    Check commands don't work well with Vim9 script.
Solution:   Improve constant expression handling.

7f829cab35

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-15 09:08:51 +08:00
zeertzjq
9dd5903273
Merge pull request #21806 from zeertzjq/vim-8.2.4565
vim-patch:8.2.{4563,4565,4570}: cmdline completion for :breakadd, :breakdel, :profdel
2023-01-15 08:38:23 +08:00
zeertzjq
064fdad98c vim-patch:8.2.4570: no command line completion for :profile and :profdel
Problem:    No command line completion for :profile and :profdel.
Solution:   Implement completion. (Yegappan Lakshmanan, closes vim/vim#9955)

1fdf84e033

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-15 07:59:45 +08:00
zeertzjq
f2056e4045 vim-patch:8.2.4565: no command line completion for :breakadd and :breakdel
Problem:    No command line completion for :breakadd and :breakdel.
Solution:   Add completion for :breakadd and :breakdel. (Yegappan Lakshmanan,
            closes vim/vim#9950)

6e2e2cc95b
2023-01-15 07:59:45 +08:00
zeertzjq
89f45dc155 vim-patch:8.2.4563: "z=" in Visual mode may go beyond the end of the line
Problem:    "z=" in Visual mode may go beyond the end of the line.
Solution:   Adjust "badlen".

5c68617d39

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-15 07:59:45 +08:00
zeertzjq
fe17cd50fb
Merge pull request #21807 from zeertzjq/vim-8.2.4579
vim-patch:8.2.{4481,4579,4585}: PageUp/PageDown for cmdline pum
2023-01-15 07:59:24 +08:00
zeertzjq
940643aa33 vim-patch:8.2.4585: cannot use keypad page-up/down for completion menu
Problem:    Cannot use keypad page-up/down for completion menu.
Solution:   Recognize the keypad keys. (Yegappan Lakshmanan, closes vim/vim#9963)

155b088208

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-15 07:36:58 +08:00
zeertzjq
066a1a069b vim-patch:8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Problem:    Cannot use page-up and page-down in the command line completion
            popup menu.
Solution:   Check for to page-up and page-down keys. (Yegappan Lakshmanan,
            closes vim/vim#9960)

5cffa8df7e

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-15 07:36:58 +08:00
zeertzjq
44710a91d0 vim-patch:8.2.4481: cmdline popup menu not removed when 'lazyredraw' is set
Problem:    Cmdline popup menu not removed when 'lazyredraw' is set.
Solution:   Temporarily reset 'lazyredraw' when removing the popup menu.
            (closes vim/vim#9857)

5c52be40fb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-15 07:00:53 +08:00
zeertzjq
4c8d707a5e
vim-patch:9.0.0876: code is indented more than needed (#21805)
Problem:    Code is indented more than needed.
Solution:   Split ExpandEscape() in two. (Yegappan Lakshmanan, closes vim/vim#11539)

68353e5270

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-15 06:34:45 +08:00
zeertzjq
f445096cc6
vim-patch:9.0.1043: macro has confusing name and is duplicated (#21801)
Problem:    Macro has confusing name and is duplicated.
Solution:   Use one macro with an understandable name. (closes vim/vim#11686)

c51a376265
2023-01-15 05:27:55 +08:00
zeertzjq
7af2c52ef0
docs: builtin TUI is no longer channel 0 (#21794) 2023-01-15 05:24:19 +08:00
zeertzjq
8b86cb8f5b
vim-patch:8.2.4406: expand functions use confusing argument names (#21800)
Problem:    Expand functions use confusing argument names.
Solution:   Rename "file" to "match".  Refactor some completion code.  Add a
            few more tests. (Yegappan Lakshmanan, closes vim/vim#9790)

2438430863

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-14 23:44:38 +08:00
dundargoc
c1fffc42fb
build: enable iwyu with target properties instead of variables (#21797)
IWYU stopped working after 438b4361cc,
likely due to the code being moved from CMakeLists.txt to
src/nvim/CMakelists.txt. Using the IWYU target property instead of the
variable ensures that the information to use IWYU isn't lost.
2023-01-14 15:37:31 +01:00
zeertzjq
686168c648
vim-patch:8.2.4398: some command completion functions are too long (#21799)
Problem:    Some command completion functions are too long.
Solution:   Refactor code into separate functions.  Add a few more tests.
            (Yegappan Lakshmanan, closes vim/vim#9785)

b31aec3b93

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-14 22:28:21 +08:00
zeertzjq
2065ce877e
vim-patch:partial:9.0.1196: code is indented more than necessary (#21796)
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes vim/vim#11813)

e857598896

Partial port as this depends on some previous eval and 'smoothscroll'
patches.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-14 21:36:15 +08:00
zeertzjq
d549734fb4
Merge pull request #21795 from zeertzjq/vim-8.2.4346
vim-patch:8.2.{4346,4382,4391},9.0.1195

N/A patches for version.c:

vim-patch:9.0.1197: dump file missing from patch

Problem:    Dump file missing from patch.
Solution:   Add missing dump file.

034c350207
2023-01-14 20:50:53 +08:00
zeertzjq
d98e4e4b2e vim-patch:9.0.1195: restoring KeyTyped when building statusline not tested
Problem:    Restoring KeyTyped when building statusline not tested.
Solution:   Add a test.  Clean up and fix other tests. (closes vim/vim#11815)

378e6c03f9
2023-01-14 20:27:40 +08:00
zeertzjq
f95ad61a89 vim-patch:8.2.4391: command line executed when typing Esc in the GUI
Problem:    Command line executed when typing Esc in the GUI.
Solution:   Move saving/restoring KeyTyped to build_stl_str_hl().
            (closes vim/vim#9783)

0e1f36fc59

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-14 20:09:56 +08:00
zeertzjq
81473c8ab2 vim-patch:8.2.4382: a custom 'tabline' may cause Esc to work like Enter
Problem:    A custom 'tabline' may cause Esc to work like Enter on the
            command line when the popup menu is displayed.
Solution:   Save and restore KeyTyped. (closes vim/vim#9776)

e4835bf340

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-14 20:09:56 +08:00
zeertzjq
ef77598bfb vim-patch:8.2.4346: a custom statusline may cause Esc to work like Enter
Problem:    A custom statusline may cause Esc to work like Enter on the
            command line when the popup menu is displayed.
Solution:   Save and restore KeyTyped. (closes vim/vim#9749)

481acb1141

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-14 20:09:56 +08:00
bfredl
bf08390442
Merge pull request #21793 from bfredl/noringbuf
fix(rbuffer): handle edge case where write_ptr has wrapped around too early
2023-01-14 13:06:22 +01:00
bfredl
8ebdb97ea7 fix(rbuffer): handle edge case where write_ptr has wrapped around
when using the rbuffer as a linear buffer, exactly filling the buffer
will case write_ptr to wrap around too early. For now detect this
special case.

Of course, the rbuffer should refactored to a proper ring buffer where
write_pos >= read_pos always and there is no special case for full
buffers. This will be a follow up change.
2023-01-14 11:53:47 +01:00
zeertzjq
d1183b48ad
vim-patch:8.2.4341: command line not redrawn when finishing popup menu (#21792)
Problem:    Command line not redrawn when finishing popup menu and the screen
            has scrolled up.
Solution:   Redraw the command line after updating the screen. (closes vim/vim#9722)

414acd342f

Code change is N/A as Nvim doesn't call update_screen() here.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-14 18:36:59 +08:00
zeertzjq
22e3b155f4
vim-patch:partial:8.2.4339: CTRL-A does not work properly with the cmdline popup menu (#21791)
Problem:    CTRL-A does not work properly with the cmdline popup menu.
Solution:   Fix issues with CTRL-A.  Add more tests for the cmdline popup
            menu.  Remove TermWait() before VeriryScreenDump().  Refactor the
            cmdline popup code. (Yegappan Lakshmanan, closes vim/vim#9735)

560dff49c0

Only port cmdexpand.c and test_cmdline.vim changes.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-14 17:23:24 +08:00
dundargoc
e89c39d6f0
refactor: replace char_u with char 21 (#21779)
refactor: replace char_u with char

Work on https://github.com/neovim/neovim/issues/459
2023-01-14 15:58:28 +08:00
dundargoc
9220755302
build: remove clint error suppression #21782
Fix remaining clint errors and remove error suppression completely.

Rename the lint targets to align with the established naming convention:

- lintc-clint lints with clint.py.
- lintc-uncrustify lints with uncrustify.
- lintc runs both targets.

lintc is also provided as a make target for convenience.

After this change we can remove these files:
https://github.com/neovim/doc/tree/gh-pages/reports/clint
https://github.com/neovim/doc/blob/main/ci/clint-errors.sh
2023-01-13 15:48:10 -08:00
zeertzjq
b884d0b370
vim-patch:9.0.1189: invalid memory access with folding and using "L" (#21787)
Problem:    Invalid memory access with folding and using "L".
Solution:   Prevent the cursor from moving to line zero.

232bdaaca9

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-14 07:02:45 +08:00
Christian Clason
fd3d30a22c
vim-patch:9.0.1191: some Bazel files are not recognized (#21784)
Problem:    Some Bazel files are not recognized.
Solution:   Add an extra Bazel pattern. (Keith Smily, closes vim/vim#11807)

3213952966

Co-authored-by: Keith Smiley <keithbsmiley@gmail.com>
2023-01-13 17:27:35 +01:00
luukvbaal
4a12372ccf
fix(statuscolumn): make %l/%r respect 'number'/'relativenumber' (#21747)
Resolve https://github.com/neovim/neovim/issues/21745.
2023-01-13 09:41:19 +00:00
zeertzjq
449c0762d3
test: avoid consecutive mouse input at different positions (#21781)
The seconds call's position may override the first call if the first
call isn't processed yet, defeating the purpose of the first call.
2023-01-13 12:25:19 +08:00
luukvbaal
1097d239c3
fix(ui): command line issues with external messages (#21709)
* fix: don't truncate external messages
* fix: avoid resizing command line with external messages
2023-01-13 11:47:55 +08:00
luukvbaal
4876654d4c
fix(mouse): statusline click registered as statuscolumn (#21748)
fix(statuscolumn): statusline click registered as statuscolumn

Problem:  Status line click is registered as status status column click.
Solution: Check that mouse is not on the status line.

Resolve https://github.com/luukvbaal/statuscol.nvim/issues/4.
2023-01-13 07:36:59 +08:00
dundargoc
f2141de9e4
refactor: replace char_u with char 20 (#21714)
refactor: replace char_u with char

Work on https://github.com/neovim/neovim/issues/459
2023-01-13 07:35:39 +08:00
Enan Ajmain
2f1fd15554
fix(powershell): wrong length allocation for ":%w !" #20530
Problem:
The calculation of `len` in `make_filter_cmd` for powershell falls short
by one character for the following ex command:
  :%w !sort
This command satisfies these conditions:
  - `itmp` is not null
  - `otmp` is null
__NOTE__ that other shells circumvent this bug only because of `len`
allocation for six extra characters: a pair of curly braces and four
spaces:
  cfdb4cbada/src/nvim/ex_cmds.c (L1551-L1554)
If allocation for these six characters are removed, then bash also faces
the same bug.

Solution:
Add allocation for 6 extra bytes. 1 would do, but let's keep powershell
in sync with other shells as much as possible.
2023-01-12 09:25:29 -08:00
Raphael
572cd8031d
feat(diagnostic): vim.diagnostic.is_disabled() #21527 2023-01-12 08:57:39 -08:00
dundargoc
a0b2c124a3
build: include our libraries before system libraries (#21746)
Including our libraries as system libraries is helpful to suppress any
warnings, but the default behavior is to include it after existing
libraries. This can become a problem with some package managers such as
macports, as CMake automatically adds /opt/local to the include path,
which is where they store all includes. This means that the wrong header
might be chosen if it has the same name as the one from our
dependencies.

Adding the BEFORE keyword when including will ensure that our
dependency headers are chosen first.

Also remove old Darwin workarounds that shouldn't be necessary anymore.

Closes: https://github.com/neovim/neovim/issues/21742
2023-01-12 16:49:17 +01:00
ii14
921e634119
fix(api): nvim_create_autocmd crash on invalid types inside pattern array
Co-authored-by: ii14 <ii14@users.noreply.github.com>
2023-01-12 15:25:44 +00:00
luukvbaal
0fd59f0121
fix(statuscolumn): foldcolumn buffer is too small (#21761)
Resolve https://github.com/neovim/neovim/issues/21759.
2023-01-12 23:04:43 +08:00
Chris Kipp
443bbfd59e
docs(lsp): fix type annotation on convert_input_to_markdown_lines (#21772)
This small changes just ensures that if you're using `convert_input_to_markdown_lines`
without `contents` you don't get a warning (when using something like neodev) that
there is an expected second param, since it can be nil.
2023-01-12 15:51:19 +01:00
zeertzjq
a5f4ba7447
vim-patch:9.0.1183: code is indented more than necessary (#21773)
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes vim/vim#11805)

0233bdfa2b

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-12 21:33:38 +08:00
Christian Clason
2aabe9b858
vim-patch:9.0.1182: go checksum files are not recognized (#21758)
Problem:    go checksum files are not recognized.
Solution:   Add the name of go checksum files. (Amaan Qureshi, closes vim/vim#11803)

043d7b2c84

Co-authored-by: Amaan Q <amaanq12@gmail.com>
2023-01-12 09:21:58 +01:00
jdrouhard
143d3f1f32
fix(lsp): revert semantic token gravity change from #21574 (#21763) 2023-01-12 07:13:52 +01:00
Chris Kipp
a37c686d21
docs(lsp): update buf_notify and rpc.notify params types (#21753)
Small, but I was getting warnings about my usage of
`vim.lsp.buf_notify(bufnr, method, {example = example})` since the docs
say that `params` must be a string, however this can really be anything
when it's passed to `rpc.notify` since we just end up calling
`vim.json.encode(payload)` on it. This fixes the docs in those two
places and regenerates them.
2023-01-11 20:17:10 +01:00
Christian Clason
8c5c2136fe
vim-patch:9.0.1176: smithy files are not recognized (#21751)
Problem:    smithy files are not recognized.
Solution:   Add a pattern for Smithy files. (Chris Kipp, closes vim/vim#11804)

f68cddabff

Co-authored-by: Chris Kipp <ckipp@pm.me>
2023-01-11 17:15:54 +01:00