Commit Graph

25725 Commits

Author SHA1 Message Date
zeertzjq
a8d9f0a2d5 vim-patch:8.1.1175: no test for dragging a tab and double click for new tab
Problem:    No test for dragging a tab with the mouse and for creating a new
            tab by double clicking in the tabline.
Solution:   Add two tests. (Dominique Pelle, closes vim/vim#4258)

e3e3828f93

Set 'mousetime' to 0 instead.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-28 16:42:26 +08:00
zeertzjq
5f710789f9 vim-patch:8.1.1167: no test for closing tab by click in tabline
Problem:    No test for closing tab by click in tabline.
Solution:   Add a test.  Also fix that dragging window separator could fail in
            a large terminal. (Dominique Pelle, closes vim/vim#4253)

39f76c6ac0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-28 16:42:26 +08:00
zeertzjq
b26e242dd3 vim-patch:8.1.1165: no test for mouse clicks in the terminal tabpage line
Problem:    No test for mouse clicks in the terminal tabpage line.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#4247).  Also init
            TabPageIdxs[], in case it's used before a redraw.

ca57ab54d7

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-28 16:42:26 +08:00
zeertzjq
718a8862ab vim-patch:8.1.1160: termcodes test would fail in a very big terminal
Problem:    Termcodes test would fail in a very big terminal.
Solution:   Bail out when the row is larger than what will work. (Dominique
            Pelle, closes vim/vim#4246)

c8b3ddab51

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-28 16:42:26 +08:00
zeertzjq
a44c8a3783 vim-patch:partial:8.1.1155: termcodes tests can be improved
Problem:    Termcodes tests can be improved.
Solution:   Add helper functions to simplify tests.  Dragging statusline for
            xterm and sgr. (Dominique Pelle, closes vim/vim#4237)

3fbd2d7c31

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-28 16:42:23 +08:00
zeertzjq
521e039f27
vim-patch:partial:8.2.0425: code for modeless selection not sufficiently tested (#23362)
Problem:    Code for modeless selection not sufficiently tested.
Solution:   Add tests.  Move mouse code functionality to a common script file.
            (Yegappan Lakshmanan, closes vim/vim#5821)

Add some mouse.vim functions that can be made to work in Nvim.

515545e11f
2023-04-28 12:44:11 +08:00
zeertzjq
95839a2358
vim-patch:9.0.1494: crash when recovering from corrupted swap file (#23358)
Problem:    Crash when recovering from corrupted swap file.
Solution:   Bail out when the line index looks wrong. (closes vim/vim#12276)

bf1b713202

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-28 06:27:51 +08:00
zeertzjq
50107c3778
Merge pull request #23352 from zeertzjq/pum-at-cursor
fix(pum): make :popup position correctly with float border
2023-04-28 06:23:19 +08:00
zeertzjq
aca226d728 vim-patch:9.0.1493: popup menu position wrong in window with toolbar
Problem:    Popup menu position wrong in window with toolbar.
Solution:   Take the window toolbar into account when positioning the popup
            menu. (closes vim/vim#12308)

4e1ca0d9a6

Fixed in the previous commit. Test only.
2023-04-28 05:56:47 +08:00
zeertzjq
fbaa278773 fix(pum): make :popup position correctly with float border 2023-04-28 05:49:47 +08:00
bfredl
f65043154e
Merge pull request #23356 from ii14/fix/23355
fix(events): null dereference in autocmd functions
2023-04-27 23:00:28 +02:00
ii14
774a32e5fe fix(events): null dereference in autocmd functions 2023-04-27 22:22:54 +02:00
dundargoc
c50cdd6270
ci: replace stale bot with custom implementation
The stale action has a bug where it won't close an issue/PR if it has
comments after the stale label.
2023-04-27 22:07:44 +02:00
ii14
1cb6040554
perf(events): store autocommands in flat vectors (#23256)
Instead of nested linked lists, store autocommands in a flat, contiguous
kvec_t, with one kvec_t per event type. Previously patterns were stored
in each node of the outer linked list, so they can be matched only once
on repeating patterns. They are now reference counted and referenced in
each autocommand, and matching is skipped if the pattern repeats. Speeds
up creation and deletion, execution is not affected.

Co-authored-by: ii14 <ii14@users.noreply.github.com>
2023-04-27 19:25:08 +02:00
Lewis Russell
eb4676c67f
fix: disallow removing extmarks in on_lines callbacks (#23219)
fix(extmarks): disallow removing extmarks in on_lines callbacks

decor_redraw_start (which runs before decor_providers_invoke_lines) gets
references for the extmarks on a specific line. If these extmarks are
deleted in on_lines callbacks then this results in a heap-use-after-free
error.

Fixes #22801
2023-04-27 17:30:22 +01:00
zeertzjq
9f29176033
vim-patch:9.0.1492: using uninitialized memory when argument is missing (#23351)
Problem:    Using uninitialized memory when argument is missing.
Solution:   Check there are sufficient arguments before the base.
            (closes vim/vim#12302)

b7f2270bab

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-28 00:01:22 +08:00
zeertzjq
a3dfe1bc89
fix(pum): position properly with ext_multigrid (#23336) 2023-04-27 20:19:21 +08:00
Christian Clason
4b3fdf321c
docs(lsp): remove obsolete lsp-extension example (#23346)
This example is made obsolete by the addition of `vim.lsp.start()` and
`vim.fs` (whose use is already documented in `:h lsp-quickstart`).
2023-04-27 13:05:26 +02:00
bfredl
0ff58d1bb9
Merge pull request #23216 from bfredl/lpeg
refactor(build): include lpeg as a library
2023-04-27 12:06:44 +02:00
bfredl
45bcf83869 refactor(build): include lpeg as a library 2023-04-27 11:40:00 +02:00
zeertzjq
d321deb4a9
test: fix dependencies between test cases (#23343)
Discovered using --shuffle argument of busted.
2023-04-27 15:51:44 +08:00
zeertzjq
d1bb9bffd5
build: remove BUSTED_PRG dead code (#23340)
BUSTED_PRG is no longer used by RunTests.cmake.
2023-04-27 14:36:37 +08:00
luukvbaal
39771b2238
build(Makefile): add nvim to oldtest phony target
This is to force a rebuild each time a file is changed.
2023-04-27 08:26:07 +02:00
zeertzjq
1fc468aed2
vim-patch:9.0.1491: wrong scrolling with ls=0 and :botright split (#23333)
Problem:    Wrong scrolling with ls=0 and :botright split.
Solution:   Add statusline before calling frame_new_height(). (closes vim/vim#12299)

fbf2071ac9
2023-04-27 09:07:30 +08:00
dundargoc
3b0df1780e
refactor: uncrustify
Notable changes: replace all infinite loops to `while(true)` and remove
`int` from `unsigned int`.
2023-04-26 23:23:44 +02:00
dundargoc
7d0479c558
ci: containerize the external dependencies test
Cirrus ci automatically pushes/caches docker images, which makes
containerization much simpler to handle. Moving this job to cirrus ci
shortens the job by a minute, and reduces github actions CI usage by two
minutes per PR.
2023-04-26 23:22:12 +02:00
dundargoc
a1b045f60a
refactor(clang-tidy): remove redundant casts 2023-04-26 18:28:49 +02:00
dundargoc
6674d706d9
ci: update reviewers 2023-04-26 18:25:27 +02:00
dundargoc
c98ef2d7c6
build(clint): fix deprecation and linter warnings
`sre_compile` is deprecated in python 11, and gives warning when is used.
2023-04-26 18:25:07 +02:00
zeertzjq
efae71819a
Merge pull request #23288 from MunifTanjim/issue-22263
fix(normal): fix repeated trigger modechanged for scheduled callback
2023-04-27 00:23:39 +08:00
Munif Tanjim
a35bca2112 test: scheduled callback shouldn't trigger ModeChanged repeatedly 2023-04-26 23:57:09 +08:00
zeertzjq
e0d6703a6a vim-patch:9.0.1490: the ModeChanged event may be triggered too often
Problem:    The ModeChanged event may be triggered too often.
Solution:   Only trigger ModeChanged when no operator is pending.
            (closes vim/vim#12298)

73916bac5a
2023-04-26 23:56:21 +08:00
bfredl
9f0762f1fe
Merge pull request #23308 from bfredl/fs_time_boogalo
refactor(fs): IT'S TIME: get rid of fs_loop and fs_loop_mutex
2023-04-26 10:28:27 +02:00
zeertzjq
55793bcfa1
build: revert accidental permission changes (#23319)
Revert the permission changes in 794d2744f3.
2023-04-26 13:38:30 +08:00
zeertzjq
191e8b4062
vim-patch:9.0.1485: no functions for converting from/to UTF-16 index (#23318)
Problem:    no functions for converting from/to UTF-16 index.
Solution:   Add UTF-16 flag to existing funtions and add strutf16len() and
            utf16idx(). (Yegappan Lakshmanan, closes vim/vim#12216)

67672ef097

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-04-26 09:50:37 +08:00
zeertzjq
8af97ecefa
vim-patch:8.2.3314: behavior of exists() in a :def function is unpredictable (#23317)
Problem:    Behavior of exists() in a :def function is unpredictable.
Solution:   Add exists_compiled().

267359902c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-26 08:37:22 +08:00
bfredl
5e569a4703 refactor(fs): now it is time to get rid of fs_loop and fs_loop_mutex
Here's the headline: when run in sync mode (last argument cb=NULL),
these functions don't actually use the uv_loop_t.

An earlier version of this patch instead replaced fs_loop with
using main_loop.uv on the main thread and luv_loop() on luv worker
threads. However this made the code more complicated for no reason.

Also arbitrarily, half of these functions would attempt to handle
UV_ENOMEM by try_to_free_memory(). This would mostly happen
on windows because it needs to allocate a converted WCHAR buffer.
This should be a quite rare situation. Your system is pretty
much hosed already if you cannot allocate like 50 WCHAR:s.
Therefore, take the liberty of simply removing this fallback.

In addition, we tried to "recover" from ENOMEM in read()/readv()
this way which doesn't make any sense. The read buffer(s) are already
allocated at this point.

This would also be an issue when using these functions on a worker
thread, as try_to_free_memory() is not thread-safe. Currently
os_file_is_readable() and os_is_dir() is used by worker threads
(as part of nvim__get_runtime(), to implement require from 'rtp' in
threads).

In the end, these changes makes _all_ os/fs.c functions thread-safe,
and we thus don't need to document and maintain a thread-safe subset.
2023-04-25 21:30:19 +02:00
zeertzjq
907018e547
vim-patch:8.2.3139: functions for string manipulation are spread out (#23316)
Problem:    Functions for string manipulation are spread out.
Solution:   Move string related functions to a new source file. (Yegappan
            Lakshmanan, closes vim/vim#8470)

a2438132a6

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-04-26 00:23:11 +08:00
zeertzjq
7e0d668012
vim-patch:partial:9.0.0359: error message for wrong argument type is not specific (#23315)
Problem:    Error message for wrong argument type is not specific.
Solution:   Include more information in the error. (Yegappan Lakshmanan,
            closes vim/vim#11037)

8deb2b30c7

Skip reduce() and deepcopy() changes because of missing patches.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-04-25 23:39:15 +08:00
zeertzjq
ac9f8669a8
vim-patch:9.0.0875: using freed memory when executing delfunc at more prompt (#23314)
Problem:    Using freed memory when executing delfunc at the more prompt.
Solution:   Check function list not changed in another place. (closes vim/vim#11437)

398a26f7fc

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-25 23:19:00 +08:00
Gregory Anders
cacc2dc419
Merge pull request #23303 from gpanders/more-vim-iter
Create iter_spec and vim.iter module
2023-04-25 09:17:46 -06:00
ii14
7e70ca0b48
feat(lua): vim.keycode (#22960)
Using nvim_replace_termcodes is too verbose, add vim.keycode for
translating keycodes.

Co-authored-by: ii14 <ii14@users.noreply.github.com>
2023-04-25 16:52:44 +02:00
zeertzjq
c111460b1a
Merge pull request #23313 from zeertzjq/vim-8.2.3768
vim-patch:8.2.{3768,3772}
2023-04-25 22:49:57 +08:00
Gregory Anders
1e73891d69 refactor(iter): move helper functions under vim.iter
vim.iter is now both a function and a module (similar to vim.version).
2023-04-25 08:23:16 -06:00
zeertzjq
1dd9cd2965 vim-patch:8.2.3772: timer info test fails on slow machine
Problem:    Timer info test fails on slow machine.
Solution:   Use WaitForAssert().

ff39a650b2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-25 22:22:40 +08:00
zeertzjq
cc6845db94 vim-patch:8.2.3768: timer_info() has the wrong repeat value in a timer callback
Problem:    timer_info() has the wrong repeat value in a timer callback.
Solution:   Do not add one to the repeat value when in the callback.
            (closes vim/vim#9294)

95b2dd0c00

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-25 22:22:40 +08:00
zeertzjq
255e547e18 fix(timer): allow timer_info() to get info about current timer 2023-04-25 22:22:40 +08:00
zeertzjq
bfa92d3861
vim-patch:8.2.5019: cannot get the first screen column of a character (#23312)
Problem:    Cannot get the first screen column of a character.
Solution:   Let virtcol() optionally return a list. (closes vim/vim#10482,
            closes vim/vim#7964)

0f7a3e1de6

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2023-04-25 22:22:26 +08:00
zeertzjq
43c49746d9
vim-patch:9.0.0335: checks for Dictionary argument often give a vague error (#23309)
Problem:    Checks for Dictionary argument often give a vague error message.
Solution:   Give a useful error message. (Yegappan Lakshmanan, closes vim/vim#11009)

04c4c5746e

Cherry-pick removal of E922 from docs from patch 9.0.1403.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-04-25 21:32:12 +08:00
zeertzjq
2e8410b7be
refactor: remove unnecessary height change in frame_add_hsep() (#23305)
This height change is wrong, and the height will be overwritten later by
another height change.
2023-04-25 18:52:58 +08:00