Commit Graph

4431 Commits

Author SHA1 Message Date
zeertzjq
428ab6f24e
fix(mark): do not restore view in op-pending mode (#20889) 2022-11-01 06:14:20 +08:00
Justin M. Keyes
cc7c378bf3 feat(checkhealth): check runtime ($VIMRUNTIME)
Move man/health.lua into the "runtime" check.

fix #20696
2022-10-30 16:23:58 +01:00
zeertzjq
23080a4d7a
fix(mouse): ensure no scrolling with "ver:0" in 'mousescroll' (#20861) 2022-10-30 07:10:39 +08:00
zeertzjq
a7d100f052
fix: avoid unsigned overflow in home_replace() (#20854) 2022-10-30 06:49:39 +08:00
zeertzjq
25cf4f2fc7 vim-patch:8.2.2653: build failure
Problem:    Build failure.
Solution:   Add missing changes.

3a0f092ac0

Omit E1176: only applicable to Vim9 script.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-27 13:07:51 +08:00
zeertzjq
cfccae9584 vim-patch:8.2.0610: some tests are still old style
Problem:    Some tests are still old style.
Solution:   Convert to new style tests. (Yegappan Lakshmanan, closes vim/vim#5957)

08f4157c5c

Fix missing error message when sort() compare function fails.
Cherry-pick a line in test_utf8.vim from patch 8.2.0448.
Cherry-pick builtin_function() change from patch 8.2.0595.
2022-10-26 20:53:39 +08:00
bfredl
40791f8e82
Merge pull request #20775 from shadmansaleh/fix/opt_tal_not_redrawing_tabline
fix: setting tabline option not redrawing tabline
2022-10-24 20:05:02 +02:00
shadmansaleh
a53998ae78 fix: setting tabline option not redrawing tabline
With #20374 tabline option is marked with 'statuslines' redraw flag.
But 'statuslines' doesn't redraw tabline. As a result, tabline doesn't
get redrawn when tabline option is set and statuslines get unnecessarily redrawn.

This patch fixes the issue by adding a new redraw flag P_RTABL to redraw
tabline.
2022-10-24 21:14:41 +06:00
NAKAI Tsuyoshi
4573cfa3ad
fix(lua): pesc, tbl_islist result types #20751
Problem:
- pesc() returns multiple results, it should return a single result.
- tbl_islist() returns non-boolean in some branches.
- Docstring: @generic must be declared first

Solution:
Constrain docstring annotations.
Fix return types.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2022-10-24 05:53:53 -07:00
zeertzjq
0ed1429fcb test: add a test for a crash fixed by patch 8.2.0908 2022-10-24 16:29:28 +08:00
dundargoc
1887d8d7d0
docs: fix typos (#20724)
Co-authored-by: Marco Lehmann <m99@posteo.de>
2022-10-23 09:45:39 +08:00
zeertzjq
2f9b94a268
fix(ui): send grid_resize events before triggering VimResized (#20760) 2022-10-22 07:53:39 +08:00
Justin M. Keyes
e6917306f6
docs: update vimdoc parser #20747
Remove the user-manual ToC from help.txt, because:
1. it duplicates usr_toc.txt
2. it is not what most readers are looking for in the main help page.

fix https://github.com/neovim/tree-sitter-vimdoc/issues/49
fix https://github.com/neovim/tree-sitter-vimdoc/issues/50
fix https://github.com/neovim/tree-sitter-vimdoc/issues/51
2022-10-20 06:20:02 -07:00
zeertzjq
96cf385a7f
vim-patch:9.0.0739: mouse column not correctly used for popup_setpos (#20729)
Problem:    Mouse column not correctly used for popup_setpos.
Solution:   Adjust off-by-one error and handle Visual line selection properly.
            (Yee Cheng Chin, closes vim/vim#11356)
17822c507c

The test_termcodes.vim test cannot be used. Use a Lua test instead.
2022-10-19 11:32:26 +08:00
Justin M. Keyes
ef4c339fb9
feat(docs): update parser, HTML gen #20720
Note: although the tolerance in help_spec.lua increased, the actual
error count with the new parser decreased by about 20%. The difference
is that the old ignore_parse_error() ignored many more errors with the
old parser.

fix https://github.com/neovim/tree-sitter-vimdoc/issues/37
fix https://github.com/neovim/tree-sitter-vimdoc/issues/44
fix https://github.com/neovim/tree-sitter-vimdoc/issues/47
2022-10-18 07:18:44 -07:00
zeertzjq
97164748b9
fix(intro): omit patch version in ":help news" item #20713
Because maintenance releases share the same news.txt as the last
non-maintenance release.
2022-10-18 03:42:32 -07:00
dundargoc
5046b4b4ad
ci: add cirrus to isCI function to skip tests (#20526)
The environment variable CIRRUS_CI is manually passed to RunTests.cmake
as it doesn't get passed when using cmake script mode.
2022-10-17 17:16:31 +02:00
zeertzjq
14a84ec169 test: add a test for #20684 2022-10-17 21:39:49 +08:00
zeertzjq
637ab296cb
feat(api): nvim_select_popupmenu_item support cmdline pum (#20652) 2022-10-17 21:00:50 +08:00
Mahmoud Al-Qudsi
39911d76be
fix(man): handle absolute paths as :Man targets (#20624)
* fix(man): handle absolute paths as :Man targets

Previously, attempting to provide `:Man` with an absolute path as the name would
cause neovim to return the following error:

```
Error detected while processing command line:
/usr/local/share/nvim/runtime/lua/man.lua:690: /usr/local/share/nvim/runtime/lua/man.lua:683: Vim:E426: tag not found: nil(nil)
Press ENTER or type command to continue
```

..because it would try to validate the existence of a man page for the provided
name by executing `man -w /some/path` which (on at least some Linux machines
[0]) returns `/some/path` instead of the path to the nroff files that would be
formatted to satisfy the man(1) lookup.

While man pages are not normally named after absolute paths, users shouldn't be
blamed for trying. Given such a name/path, neovim would **not** complain that
the path didn't have a corresponding man file but would error out when trying
to call the tag function for the null-propagated name-and-section `nil(nil)`.
(The same underlying error existed before this function was ported to lua, but
did not exhibit the lua-specific `nil(nil)` name; instead a tag lookup for `()`
would fail and error out.)

With this patch, we detect the case where `man -w ...` returns the same value as
the provided name to not only prevent invoking the tag function for a
non-existent/malformed name+sect but also to properly report the non-existence
of a man page for the provided lookup (the absolute path).

While man(1) can be used to directly read an nroff-formatted document via `man
/path/to/nroff.doc`, `:Man /path/to/nroff.doc` never supported this behavior so
no functionality is lost in case the provided path _was_ an nroff file.

[0]: `man -w /absolute/path` returning `/absolute/path` observed on an Ubuntu
18.04 installation.

* test: add regression test for #20624

Add a functional test to `man_spec.lua` to check for a regression for #20624 by
first obtaining an absolute path to a random file and materializing it to disk,
then attempting to query `:Man` for an entry by that same name/path.

The test passes if nvim correctly reports that there is no man page
correspending to the provided name/path and fails if any other error (or no
error) is shown.
2022-10-17 10:37:44 +01:00
Lewis Russell
190019dd79
Merge pull request #20665 from lewis6991/fix/decor_redraw 2022-10-17 10:19:26 +01:00
Christian Clason
9701c9dc9f
vim-patch:3c053a1a5ad2 (#20679)
Update runtime files
3c053a1a5a
2022-10-17 08:19:48 +02:00
Gregory Anders
935e1ca743
feat: mention ":help news" in intro #20674 2022-10-16 14:55:18 -07:00
Lewis Russell
2921de6a96 fix(decoration): call providers in win_update() earlier
Fixes #20651
2022-10-15 18:06:59 +01:00
zeertzjq
6bc2d6b66b vim-patch:9.0.0614: SpellFileMissing autocmd may delete buffer
Problem:    SpellFileMissing autocmd may delete buffer.
Solution:   Disallow deleting the current buffer to avoid using freed memory.
ef976323e7
2022-10-15 16:28:36 +08:00
Lewis Russell
cb7da02701
Merge pull request #20645 from lewis6991/fix/decor_redraw_same_id
fix(decoration): redraw correctly when re-using ids
2022-10-14 20:46:26 +01:00
zeertzjq
e6f7e038b8
fix(completion): set pum_size even if ext_popupmenu is used (#20648)
This allows CompleteChanged event to get the correct `v:event.size`.
It should be harmless and more consistent to also set `pum_array`.
2022-10-14 23:08:00 +08:00
Lewis Russell
546b294e74 fix(decoration): redraw correctly when re-using ids
00cfc1d (from #20249) reduced the amount of unnecessary redraws. This
surfaced an issue where if and extmark with a specific ID is
repositioned to a different row, the decorations from the old row were
not redrawn and removed. This change fixes that by redrawing the
old row.
2022-10-14 13:03:03 +01:00
Daniel Zhang
81986a7349
fix(lua): on_yank error with blockwise multibyte region #20162
Prevent out of range error when calling `str_byteindex`.
Use `vim.str_byteindex(bufline, #bufline)` to cacluate utf length of `bufline`.
fix #20161
2022-10-14 02:12:46 -07:00
Justin M. Keyes
d339b4aad7
build(deps): bump vimdoc (help) parser to v1.2.1 #20642 2022-10-13 18:36:25 -07:00
zeertzjq
9115f66555 test: add a test for #20605 2022-10-12 11:50:40 +08:00
RZia
a5597d1fc0
fix(lua): assert failure with vim.regex() error inside :silent! (#20555)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-10-10 08:04:08 +08:00
Justin M. Keyes
09dffb9db7
docs: various #12823
- increase python line-length limit from 88 => 100.
- gen_help_html: fix bug in "tag" case (tbl_count => tbl_contains)

ref #15632
fix #18215
fix #18479
fix #20527
fix #20532

Co-authored-by: Ben Weedon <ben@weedon.email>
2022-10-09 05:21:52 -07:00
zeertzjq
7cdaa74b36 vim-patch:9.0.0702: incomplete testing cursor position with 'linebreak' set
Problem:    Incomplete testing cursor position after change with 'linebreak'
            set.
Solution:   Add a test and move test cases together. (closes vim/vim#11313)
30c0c467d6
2022-10-09 19:09:32 +08:00
zeertzjq
2a12faaec1
fix(api): dynamically allocate line buffer for nvim_out_write (#20537) 2022-10-08 20:10:00 +08:00
lvimuser
0773a9ee3a
feat(lsp): support window/showDocument (#19977) 2022-10-08 10:22:25 +02:00
zeertzjq
cfdb4cbada
fix: find multibyte file name in line (#20519)
And remove unnecessary unsigned casts in fold marker comparison.
2022-10-07 09:43:16 +08:00
zeertzjq
d191070913
fix(ui): setting 'cmdheight' with global statusline (#20515) 2022-10-07 08:52:51 +08:00
Justin M. Keyes
f7b175e049
fix(docs-html): keycodes, taglinks, column_heading #20498
Problem:
- Docs HTML: "foo ~" headings (column_heading) are not aligned with
  their table columns/contents because the leading whitespace is not
  emitted.
- taglinks starting with hyphen like |-x| were not recognized.
- keycodes like `<foo>` and `CTRL-x` were not recognized.
- ToC is not scrollable.

Solution:
- Add ws() to the column_heading case.
- Update help parser to latest version
  - supports `keycode`
  - fixes for taglink, argument
- Update .toc CSS. https://github.com/neovim/neovim.github.io/issues/297

fix https://github.com/neovim/neovim.github.io/issues/297
2022-10-06 06:16:00 -07:00
zeertzjq
25dea99ce5
vim-patch:9.0.0670: no space for command line when there is a tabline (#20512)
Problem:    No space for command line when there is a tabline.
Solution:   Correct computation of where the command line should be.
            (closes vim/vim#11295)
c9f5f73206
2022-10-06 20:03:59 +08:00
luukvbaal
5acf52e19b
feat(window/ui): add splitkeep option (#19243)
vim-patch:9.0.0445: when opening/closing window text moves up/down

Problem:    When opening/closing window text moves up/down.
Solution:   Add the 'splitscroll' option.  When off text will keep its
            position as much as possible.
29ab524358

vim-patch:9.0.0455: a few problems with 'splitscroll'

Problem:    A few problems with 'splitscroll'.
Solution:   Fix 'splitscroll' problems. (Luuk van Baal, closes vim/vim#11117)
5ed391708a

vim-patch:9.0.0461: 'scroll' is not always updated

Problem:    'scroll' is not always updated.
Solution:   Call win_init_size() at the right place.
470a14140b

vim-patch:9.0.0465: cursor moves when cmdwin is closed when 'splitscroll' is off

Problem:    Cursor moves when cmdwin is closed when 'splitscroll' is off.
Solution:   Temporarily set 'splitscroll' when jumping back to the original
            window. (closes vim/vim#11128)
e697d48890

vim-patch:9.0.0469: cursor moves if cmdwin is closed when 'splitscroll' is off

Problem:    Cursor moves if cmdwin is closed when 'splitscroll' is off.
Solution:   Skip win_fix_cursor if called when cmdwin is open or closing.
            (Luuk van Baal, closes vim/vim#11134)
3735f11050

vim-patch:9.0.0478: test for 'splitscroll' takes too much time

Problem:    Test for 'splitscroll' takes too much time.
Solution:   Only test some of the combinations. (Luuk van Baal, closes vim/vim#11139)
594f9e09cd

vim-patch:9.0.0486: text scrolled with 'nosplitscroll', autocmd win and help

Problem:    Text scrolled with 'nosplitscroll', autocmd win opened and help
            window closed.
Solution:   Skip win_fix_scroll() in more situations. (Luuk van Baal,
            closes vim/vim#11150)
d5bc762dea

vim-patch:9.0.0505: various problems with 'nosplitscroll'

Problem:    Various problems with 'nosplitscroll'.
Solution:   Fix 'nosplitscroll' problems. (Luuk van Baal, closes vim/vim#11166)
faf1d412f5

vim-patch:9.0.0555: scrolling with 'nosplitscroll' in callback changing curwin

Problem:    Scrolling with 'nosplitscroll' in callback changing curwin.
Solution:   Invalidate w_cline_row in the right place. (Luuk van Baal,
            closes vim/vim#11185)
20e58561ab

vim-patch:9.0.0603: with 'nosplitscroll' folds are not handled correctly

Problem:    With 'nosplitscroll' folds are not handled correctly.
Solution:   Take care of closed folds when moving the cursor. (Luuk van Baal,
            closes vim/vim#11234)
7c1cbb6cd4

vim-patch:9.0.0605: dump file missing

Problem:    Dump file missing.
Solution:   Add the missing dump file. (issue vim/vim#11234)
439a2ba174

vim-patch:9.0.0647: the 'splitscroll' option is not a good name

Problem:    The 'splitscroll' option is not a good name.
Solution:   Rename 'splitscroll' to 'splitkeep' and make it a string option,
            also supporting "topline". (Luuk van Baal, closes vim/vim#11258)
13ece2ae1d

vim-patch:9.0.0667: ml_get error when 'splitkeep' is "screen"

Problem:    ml_get error when 'splitkeep' is "screen". (Marius Gedminas)
Solution:   Check the botline is not too large. (Luuk van Baal,
            closes vim/vim#11293, closes vim/vim#11292)
346823d3e5
2022-10-06 14:57:52 +08:00
zeertzjq
bc64aa435b
vim-patch:9.0.0665: setting 'cmdheight' has no effect if last window was resized (#20500)
Problem:    Setting 'cmdheight' has no effect if last window was resized.
Solution:   Do apply 'cmdheight' when told to.  Use the frame height instead
            of the cmdline_row.  (closes vim/vim#11286)
0816f473ab
2022-10-06 09:03:49 +08:00
bfredl
6ae4a6e071
Merge pull request #20374 from bfredl/notype
screen: refactor old curwin-heavy logic and graduate "msgsep" feature
2022-10-05 21:50:12 +02:00
bfredl
6ae144a921 feat(messages)!: graduate the 'msgsep' feature
The old behaviour (e.g. via `set display-=msgsep`) will not be available.
Assuming that messages always are being drawn on msg_grid
(or not drawn at all, and forwarded to `ext_messages` enabled UI)
will allows some simplifcations and enhancements moving forward.
2022-10-05 20:12:59 +02:00
zeertzjq
824a31cd0d vim-patch:8.2.3885: arglist test fails
Problem:    Arglist test fails.
Solution:   Adjust for locking the arglist for ":all".
679140c56b
2022-10-05 22:40:28 +08:00
bfredl
1f2ded459a
Merge pull request #20494 from bfredl/shadatest
test(shada): fix shada syntax definitions test.
2022-10-05 14:58:27 +02:00
bfredl
9d8546e0c5 test(shada): fix shada syntax definitions test
These tests contained errors due to synstack() and friends do not ensure
syntax state is fully synced. Actually expecting what the user will
see with a screen test does ensure it is fully synced.
2022-10-05 13:46:52 +02:00
bfredl
f572718480
Merge pull request #20493 from bfredl/windowtest
test(api): migrate screenchar() test in in window API to screen test
2022-10-05 12:10:40 +02:00
bfredl
fc1f84c4c5 test(api): migrate screenchar() test in in window API to screen test
This produces actual output in case of regressions.
2022-10-05 11:32:13 +02:00
zeertzjq
98bb2c1930 vim-patch:9.0.0661: multi-byte "lastline" in 'fillchars' does not work properly
Problem:    Multi-byte "lastline" item in 'fillchars' does not work properly
            when the window is two columns wide.
Solution:   Compute the text length correctly. (closes vim/vim#11280)
18b3500b8c
2022-10-05 06:59:05 +08:00