Commit Graph

25694 Commits

Author SHA1 Message Date
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
bfredl
965ad7726f
Merge pull request #23293 from bfredl/bigsleep
refactor(time): refactor delay with input checking
2023-04-25 12:32:06 +02:00
luukvbaal
a4b2400804
fix(statusline): also allow right click when 'mousemodel' is "popup*" (#23258)
Problem:    The 'statusline'-format ui elements do not receive right
            click events when "mousemodel" is "popup*"
Solution:   Do not draw popupmenu and handle click event instead.
2023-04-25 11:05:04 +08:00
Gregory Anders
147bb87245 test: move vim.iter tests to separate file 2023-04-24 20:31:25 -06:00
bfredl
0d2fe77865 refactor(time): refactor delay with input checking
Previously, there were three low-level delay entry points

- os_delay(ms, ignoreinput=true): sleep for ms, only break on got_int

- os_delay(ms, ignoreinput=false): sleep for ms, break on any key input
  os_microdelay(us, false): equivalent, but in μs (not directly called)

- os_microdelay(us, true): sleep for μs, never break.

The implementation of the latter two both used uv_cond_timedwait()
This could have been for two reasons:
 1. allow another thread to "interrupt" the wait
 2. uv_cond_timedwait() has higher resolution than uv_sleep()

However we (1) never used the first, even when TUI was a thread, and
(2) nowhere in the codebase are we using μs resolution, it is always a ms
multiplied with 1000.

In addition, os_delay(ms, false) would completely block the thread for
100ms intervals and in between check for input. This is not how event handling
is done alound here.

Therefore:

Replace the implementation of os_delay(ms, false) to use
LOOP_PROCESS_EVENTS_UNTIL which does a proper epoll wait with a timeout,
instead of the 100ms timer panic.

Replace os_microdelay(us, false) with a direct wrapper of uv_sleep.
2023-04-24 17:38:19 +02:00
luukvbaal
bab4bcdefb
fix(column): don't reset 'statuscolumn' width after it has been drawn
Problem:     'statuscolumn' width may be reset after it has been drawn
              when multiple windows contain the same buffer. This results
              in an offset for the drawn cursor position.
Solution:     Loop over all windows (twice) prior to drawing them to
              reset the 'statuscolumn' width and validate the sign
              column when necessary.
2023-04-24 15:22:11 +01:00
zeertzjq
c1331a65dd
fix(pum): show right-click menu above cmdline area (#23298) 2023-04-24 09:26:10 +08:00
dundargoc
664f2749e6
build: add "ci" configure preset to reduce verbosity
`cmake --preset ci`

is equivalent to

`cmake -B build -G Ninja -D CI_BUILD=ON`

Also remove build presets as they're not very useful without workflow
presets, which are only available in schema versions 6 and above.
2023-04-23 17:12:46 +02:00
dundargoc
943ac2be55
ci: reuse script to enable Developer Command Prompt 2023-04-23 16:35:49 +02:00
Christian Clason
e3f36377c1
vim-patch:71badf9547e8 (#23285)
Update runtime files

71badf9547

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-23 15:22:55 +02:00
Christian Clason
f17bb4f411
vim-patch:9.0.1478: filetypes for *.v files not detected properly (#23282)
* vim-patch:9.0.1478: filetypes for *.v files not detected properly

Problem:    Filetypes for *.v files not detected properly.
Solution:   Use the file contents to detect the filetype. (Turiiya,
            closes vim/vim#12281)

80406c2618

Co-authored-by: Turiiya <34311583+tobealive@users.noreply.github.com>
Co-authored-by: Jonas Strittmatter <40792180+smjonas@users.noreply.github.com>
2023-04-23 14:15:52 +02:00
dundargoc
bf0ac4f241
ci(release): clean up wording and undeprecate tar.gz 2023-04-23 12:15:28 +02:00
zeertzjq
1355861b92
fix(typval): don't treat v:null as truthy (#23281) 2023-04-23 17:44:08 +08:00
Dhruv Manilawala
3ac952d4e2
fix(api): avoid assertion when autocmd group id is 0 (#23210) 2023-04-23 09:23:25 +08:00
zeertzjq
77ff25b1d9
vim-patch:9.0.1477: crash when recovering from corrupted swap file (#23273)
Problem:    Crash when recovering from corrupted swap file.
Solution:   Check for a valid page count. (closes vim/vim#12275)

b67ba03d3e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-23 08:24:10 +08:00
zeertzjq
431b152726
vim-patch:9.0.1479: small source file problems; outdated list of distrib. files (#23272)
Problem:    Small source file problems; outdated list of distributed files.
Solution:   Small updates to source files and list of distributed files.

f39d9e9dca

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-23 08:12:44 +08:00
jdrouhard
540d6c595b
test(lsp): fix unstable tests for semantic tokens
Add screen:expect() calls after insert() to make sure the screen has
been drawn before we assert the state of the semantic tokens table
2023-04-23 00:08:28 +02:00
dundargoc
eee97300ed
ci(labeler): reuse workflow to reduce duplication 2023-04-22 23:28:39 +02:00
dundargoc
8994389845
ci: make all linux releases work with same glibc version 2023-04-22 22:58:14 +02:00
dundargoc
801ac2accb
build: drop diff.exe from windows builds
The shipped versions of xdiff already does everything diff does, so this
duplication of tools isn't necessary. Furthermore, this setup is more
consistent overall, as the 'diffopt=external' option should be for
external programs rather than programs we bundle neovim with.

Install diffutils for oldtests in CI to avoid needing to modify tests.
2023-04-22 18:36:33 +02:00
zeertzjq
040d9da5c8
vim-patch:9.0.1476: lines put in non-current window are not displayed (#23265)
Problem:    Lines put in non-current window are not displayed. (Marius
            Gedminas)
Solution:   Don't increment the topline when inserting just above it.
            (closes vim/vim#12212)

e7f05a8780

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-23 00:30:52 +08:00
zeertzjq
1cb46abff1
vim-patch:9.0.1475: busted configuration files are not recognized (#23266)
Problem:    Busted configuration files are not recognized.
Solution:   Recognize busted configuration files as Lua. (Craig MacEachern,
            closes vim/vim#12209)

Co-authored-by: C.D. MacEachern <craig.daniel.maceachern@gmail.com>
2023-04-22 23:51:53 +08:00
dundargoc
ccce200cde
ci(lintcommit): fix error output
Using print() alone doesn't work properly, toggling the verbose option
is still required.
2023-04-22 17:37:45 +02:00
Lewis Russell
732cb9e1e0
ci(lintcommit): use nvim -l 2023-04-22 15:10:35 +02:00
bfredl
d89eb71040
Merge pull request #23263 from bfredl/notapple
fix(cmake): restore previously undocumented workround, now documented
2023-04-22 14:40:12 +02:00
bfredl
e51e524175 fix(cmake): restore previously undocumented workround, now documented 2023-04-22 14:18:24 +02:00
dundargoc
669030ec08
ci: remove team reviewers
Team reviewers is a nice feature that comes with a severe drawback: it
makes testing the workflows incredibly difficult as they won't work
without a similar token by the tester.
2023-04-22 13:50:27 +02:00
Lewis Russell
515106ac08
Merge pull request #23255 from lewis6991/vimpatch/9.0.1293
vim-patch:9.0.{1293,1308,1311}: refactor option.c
2023-04-22 12:21:45 +01:00
Christian Clason
0b24ab1892
build(deps): bump tree-sitter to HEAD - 321a65262 (#23261) 2023-04-22 12:58:35 +02:00
T727
d9f78b6336
docs(powershell): use tee.exe instead of Tee-Object
Problem: Tee-Object does not create a file if it does not receive input
for example when :grep does not find matches.
and so nvim tries to open a nonexistent errorfile causing an error.

Solution: use tee.exe instead of Tee-Object
2023-04-22 12:04:05 +02:00
Lewis Russell
4d7a8b47b9 vim-patch:9.0.1311: Coverity warns for using a NULL pointer
Problem:    Coverity warns for using a NULL pointer.
Solution:   Use "empty_option" instead of NULL.

339e114d70

N/A patches for version.c:

vim-patch:9.0.1405: missing check for out-of-memory

Problem:    Missing check for out-of-memory.
Solution:   Check for alloc() returning NULL pointer. (closes vim/vim#12149)

14338024c1
2023-04-22 11:02:16 +01:00
Lewis Russell
a093c66bcd vim-patch:9.0.1308: the code for setting options is too complicated
Problem:    The code for setting options is too complicated.
Solution:   Refactor the code for setting options. (Yegappan Lakshmanan,
            closes vim/vim#11989)

1a6476428f
2023-04-22 11:02:04 +01:00