aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* fix(api): open_win fire Buf* events when !enter && !noautocmd if entered earlySean Dewar2024-03-08
| | | | | | | | | | | | | Problem: if switch_win{_noblock} fails to restore the old curwin after WinNew (e.g: it was closed), wp will become the new curwin, but win_set_buf enter events would still be blocked if !enter && !noautocmd. Solution: fire them, as we've actually entered the new window. Note: there's a problem of switch_win{_noblock} failing to restore the old curwin, leaving us in wp without triggering WinEnter/WinLeave, but this affects all callers of switch_win{_noblock} anyways. (It's also not clear how WinLeave can be called if the old curwin was closed already).
* fix(api): open_win fire BufWinEnter for other buffer when !enter && !noautocmdSean Dewar2024-03-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: BufWinEnter is not fired when not entering a new window, even when a different buffer is specified and buffer-related autocommands are unblocked (!noautocmd). Solution: fire it in the context of the new window and buffer. Do not do it if the buffer is unchanged, like :{s}buffer. Be wary of autocommands! For example, it's possible for nvim_win_set_config to be used in an autocommand to move a window to a different tabpage (in contrast, things like wincmd T actually create a *new* window, so it may not have been possible before, meaning other parts of Nvim could assume windows can't do this... I'd be especially cautious of logic that restores curwin and curtab without checking if curwin is still valid in curtab, if any such logic exists). Also, bail early from win_set_buf if setting the temp curwin fails; this shouldn't be possible, as the callers check that wp is valid, but in case that's not true, win_set_buf will no longer continue setting a buffer for the wrong window. Note that pum_create_float_preview also uses win_set_buf, but from a glance, doesn't look like it properly checks for autocmds screwing things up (win_enter, nvim_create_buf...). I haven't addressed that here. Also adds some test coverage for nvim_open_win autocommands. Closes #27121.
* fix(api): win_set_config fires unnecessary autocmdsSean Dewar2024-03-08
| | | | | | | | | | | | | | Problem: win_set_config should have the observable effect of moving an existing window to another place, but instead fires autocommands as if a new window was created and entered (and does not fire autocommands reflecting a "return" to the original window). Solution: do not fire win_enter-related autocommands when splitting the window, but continue to fire them when entering the window that fills the new space when moving a window to a different tabpage, as the new curwin changes. Also, remove "++once" from the WinEnter autocmd in the other test, as omitting it also crashed Nvim before this fix.
* fix(api): win_set_config autocmds crash when moving win to other tabpageSean Dewar2024-03-08
| | | | | | | | | | | | Problem: win_enter autocommands can close new_curwin, crashing if it was the last window in its tabpage after removing win, or can close parent, crashing when attempting to split it later. Solution: remove win first, check that parent is valid after win_enter. NOTE: This isn't actually quite right, as this means win is not in the window list or even has a frame when triggering enter autocommands (so it's not considered valid in the tabpage). This is addressed in later commits.
* fix(fileio): fix off-by-one in rename_with_tmp (#27780)Colin Watson2024-03-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | `_FORTIFY_SOURCE` on Ubuntu caught this, resulting in: [OLDTEST] Running test_rename Failed: test_rename :: Nvim exited with non-zero code Job exited with code 134 Screen (23 lines) ================================================================================ "test_rename.vim" "test_rename.vim" 120L, 3623B Executing Test_rename_copy() Executing Test_rename_dir_to_dir() Executing Test_rename_fails() Error detected while processing command line..script /<<BUILDDIR>>/neovim-0.9.5/test/old/testdir/runtest.vim[437]..function RunTheTest[44]..Test_rename_fails: line 17: E730: using List as a String line 18: E976: using Blob as a String Executing Test_rename_file_ignore_case()*** buffer overflow detected ***: terminated `snprintf`'s second parameter should be no greater than the number of remaining bytes in the allocated object. We can see that this was off by one, because in the simple case where `tail == tempname` (for a file in the current directory), `rename_with_tmp` was passing `MAXPATHL + 2` for an object allocated with a size of only `MAXPATHL + 1`. Introduced in 5f1a153831d480180b2203120cff776d771ec1a4.
* ci: allow skipping news workflow with a labeldundargoc2024-03-08
| | | | | | | | | | Setting the label `ci:skip-news` will skip the job. This is useful for maintainers to indicate to contributors that a feature isn't big enough to warrant a news entry, or for contributors who dislike red CI even if there's nothing wrong. Also change label `ci-s390x` to `ci:s390x`; this way it'll be easier to see that `ci:` are a subcategory of labels that affect CI in some way.
* Merge pull request #27775 from bfredl/nouidatabfredl2024-03-08
|\ | | | | refactor(ui): remove outdated UI vs UIData distinction
| * refactor(ui): remove outdated UI vs UIData distinctionbfredl2024-03-08
|/ | | | | | | | Just some basic spring cleaning. In the distant past, not all UI:s where remote UI:s. They still aren't, but both of the "UI" and "UIData" structs are now only for remote UI:s. Thus join them as "RemoteUI".
* Merge pull request #27655 from bfredl/mpack_objbfredl2024-03-08
|\ | | | | refactor(msgpack): allow flushing buffer while packing msgpack
| * refactor(msgpack): allow flushing buffer while packing msgpackbfredl2024-03-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Before, we needed to always pack an entire msgpack_rpc Object to a continous memory buffer before sending it out to a channel. But this is generally wasteful. it is better to just flush whatever is in the buffer and then continue packing to a new buffer. This is also done for the UI event packer where there are some extra logic to "finish" of an existing batch of nevents/ncalls. This doesn't really stop us from flushing the buffer, just that we need to update the state machine accordingly so the next call to prepare_call() always will start with a new event (even though the buffer might contain overflow data from a large event).
* | vim-patch:8.2.5077: various warnings from clang on MS-Windows (#27773)zeertzjq2024-03-08
| | | | | | | | | | | | | | | | Problem: Various warnings from clang on MS-Windows. Solution: Avoid the warnings. (Yegappan Lakshmanan, closes vim/vim#10553) https://github.com/vim/vim/commit/a34b4460c2843c67a35a2d236b01e6cb9bc38734 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* | test(old): change back to using termopen() on Windows (#27772)zeertzjq2024-03-08
| | | | | | It no longer hangs on Windows CI.
* | test(tohtml_spec): don't use hard-coded sleeping time (#27770)zeertzjq2024-03-08
| | | | | | Instead cause some changes to screen state and use screen:expect().
* | fix(process): avoid potential data race on exit (#27769)zeertzjq2024-03-08
| | | | | | | | | | On exit, pty_process_close() may be called after pty_process_finish1() but before start_wait_eof_timer(), in which case the timer shouldn't be started because pty_process_close() has already closed it.
* | Merge pull request #27767 from zeertzjq/vim-9.1.0154zeertzjq2024-03-08
|\ \ | | | | | | vim-patch:9.1.{0154,0158}: shm=F not respected when reloading buffer with 'autoread'
| * | vim-patch:9.1.0158: 'shortmess' "F" flag doesn't work properly with 'autoread'zeertzjq2024-03-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: 'shortmess' "F" flag doesn't work properly with 'autoread' (after 9.1.0154) Solution: Hide the file info message instead of the warning dialog (zeertzjq) closes: vim/vim#14159 closes: vim/vim#14158 https://github.com/vim/vim/commit/8a01744c563f615ae7f6b3ab7f5208214a45a8e2
| * | vim-patch:9.1.0154: shm=F not respected when reloading buffer with 'autoread'zeertzjq2024-03-08
|/ / | | | | | | | | | | | | | | | | | | | | | | Problem: shm=F not respected when reloading buffer with 'autoread' Solution: Check SHM_FILEINFO in buf_check_timestamp() (Shougo Matsushita) closes: vim/vim#14144 https://github.com/vim/vim/commit/9db39b0ec90600bb41faec3a12b934b17c298b1f Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
* | vim-patch:9.1.0157: Duplicate assignment in f_getregion() (#27766)zeertzjq2024-03-08
| | | | | | | | | | | | | | | | | | Problem: Duplicate assignment in f_getregion(). Solution: Remove the duplicate assignment. Also improve getregion() docs wording and fix an unrelated typo (zeertzjq) closes: vim/vim#14154 https://github.com/vim/vim/commit/0df8f93bdaea77a1afb9f4eca94fe67ec73e6df2
* | fix(process): close handles and timer in pty_process_close() (#27760)zeertzjq2024-03-07
| | | | | | This should prevent use-after-free on exit on Windows.
* | fix(type): remove incorrect arguments from vim.rpc*altermo2024-03-07
| |
* | feat(lua): deprecate vim.tbl_add_reverse_lookupMaria José Solano2024-03-07
|/
* vim-patch:9.1.0155: can only get getregion() from current buffer (#27757)zeertzjq2024-03-07
| | | | | | | | | | | Problem: can only call getregion() for current buffer Solution: Allow to retrieve selections from different buffers (Shougo Matsushita) closes: vim/vim#14131 https://github.com/vim/vim/commit/84bf6e658da51126bdd2e50af1f40cabd149343f Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
* fix(fs): use generics for better typingaltermo2024-03-06
|
* docs(lsp): nits and typos in client.luaMaria José Solano2024-03-06
|
* fix(types): move type annotation for `IterMod`Will Hopkins2024-03-06
|
* refactor(types): more fixes (2)Lewis Russell2024-03-06
|
* docs(treesitter): fix ambiguous parameter description about `lang`Yi Ming2024-03-06
|
* fix(lsp): actually send diagnostic-tags back to the serverLewis Russell2024-03-06
| | | | Fixes #27318
* feat(lsp): report fswatch errorsLewis Russell2024-03-06
| | | | | | Resolves #27713 Co-authored-by: Tomasz N <przepompownia@users.noreply.github.com>
* refactor(lua): more efficient vim.tbl_islistLewis Russell2024-03-06
| | | | | No need to run a full iteration of the table. Simply return false when the next key isn't what we expect.
* refactor(types): more fixesLewis Russell2024-03-06
|
* vim-patch:63c39e4ef749Christian Clason2024-03-06
| | | | | | | | | | | runtime(c): Recognize "__inline" (vim/vim#14145) `__inline` is recognized by GCC, and may even be preferred, as MSVC does not recognize `__inline__`. https://github.com/vim/vim/commit/63c39e4ef749883e96a83b9f647ac91516c0d1be Co-authored-by: Wu Yongwei <wuyongwei@gmail.com>
* docs(lua): improvements for LSP and DiagnosticLewis Russell2024-03-05
|
* fix(eval): make has('pythonx') work properly (#27739)zeertzjq2024-03-05
| | | | Problem: has('pythonx') always returns 1. Solution: Make it the same as has('python3').
* vim-patch:e5c9ba601573 (#27737)zeertzjq2024-03-05
| | | | | | | | | | | | | | | | | | runtime(vim): Update base-syntax, fix escaping :syn and :hi sub-groups (vim/vim#14137) * runtime(vim): Update base-syntax, fix escaping :syn and :hi sub-groups - Remove contained :syntax and :highlight sub-groups from the function body cluster. These should only match in the respective commands. - Remove vimSynLine syntax group from several clusters. The definition of vimSynLine was removed in Vim 5.3. * runtime(vim): Update syntax generator, use standard Last Change date format The de facto standard date format is YYYY MMM DD. https://github.com/vim/vim/commit/e5c9ba6015735b8b12e35dc5873bfc957dcbb600 Co-authored-by: dkearns <dougkearns@gmail.com>
* vim-patch:d9ebd46bd090Christian Clason2024-03-04
| | | | | | | | | | | | runtime(mswin): Use unnamed register when clipboard not working (vim/vim#13813) * Use unnamed register while clipboard not exist * Do not need to specify the unnamed register explicitly fixes: vim/vim#13809 https://github.com/vim/vim/commit/d9ebd46bd090c598adc82e683b4462909f2d4ea5 Co-authored-by: Shixian Li <34830785+znsoooo@users.noreply.github.com>
* vim-patch:1bdc9435c1a1Christian Clason2024-03-04
| | | | | | | | | | | | | runtime(sh): Update syntax file, fix issue vim/vim#962 (vim/vim#14138) Allow the opening parenthesis of a multiline array assignment, within an if statement, to appear at EOL. Fixes issue vim/vim#962. https://github.com/vim/vim/commit/1bdc9435c1a14ca1a30e5b5927ab63f603ec4409 Co-authored-by: dkearns <dougkearns@gmail.com>
* vim-patch:e84490311ba3Christian Clason2024-03-04
| | | | | | | | runtime(css): update syntax script https://github.com/vim/vim/commit/e84490311ba32cb258cc738bc3caa8b448c84c8b Co-authored-by: Jay Sitter <jay@jaysitter.com>
* fix(ui_client): check return value of channel_job_start (#27729)Sean Dewar2024-03-04
| | | | | | | | | | | | Problem: null pointer member access in ui_client_start_server if channel_job_start returns NULL. Solution: check for it, return 0 in that case (which is already used to indicate failure and is handled by main). Happened on Linux when trying to run Nvim in an old gdbserver instance after having rebuilt Nvim since. This gave E903 (the nvim binary was deleted, so " (deleted)" appears as a suffix in the `v:progpath`, making it invalid), then ASAN complains due to the NPD; instead it now then prints "Failed to start Nvim server!", as expected.
* fix(tohtml): replace hex escape with digit escape (#27728)altermo2024-03-04
|
* docs(lua): clarify when `vim.bo`/`vim.wo` acts like `:setlocal` (#27708)Luna Saphie Mittelbach2024-03-04
|
* Merge pull request #27724 from zeertzjq/vim-c4aef9a97b36zeertzjq2024-03-04
|\ | | | | vim-patch:c4aef9a97b36,691aee8b0705
| * vim-patch:691aee8b0705zeertzjq2024-03-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | runtime(vim): Update base-syntax, fix issue vim/vim#14135 (vim/vim#14136) Fix incorrect error highlighting for function calls in :command definitions. vimFunctionError should be restricted to :function header lines. fixes: vim/vim#14135 https://github.com/vim/vim/commit/691aee8b070506e6eea8ec166bf69d9a03002790 Co-authored-by: dkearns <dougkearns@gmail.com>
| * vim-patch:c4aef9a97b36zeertzjq2024-03-04
|/ | | | | | | | | | | | | runtime(vim): Update base-syntax, improve :augroup highlighting (vim/vim#14125) - Explicitly match the bang and group name in :aug! {name}. - Allow any characters in a group name. - Match default group switch marker, END. - Match :aug without arguments (list command). https://github.com/vim/vim/commit/c4aef9a97b3673a12de7a131d239e7f49d11f630 Co-authored-by: dkearns <dougkearns@gmail.com>
* fix(eval): correct failure return value for readfile/blob (#27722)Sean Dewar2024-03-03
| | | | | Currently returns 0 on failure, but should return an empty list (or blob). Regressed in the big blob port of '21 (#15211).
* vim-patch:b3030b653bbdChristian Clason2024-03-03
| | | | | | | | | | | | | | | | | | | | | | runtime(java): Recognise text blocks (vim/vim#14128) Also, accept as valid the space escape sequence `\s`. Also, consistently use the claimed `javaDebug` prefix for syntax group definitions kept under `g:java_highlight_debug`. Since `javaStringError` is commented out for its generality, let's comment out `javaDebugStringError`, its copy, as well. References: https://openjdk.org/jeps/378 https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.10.7 Closes vim/vim#10910. https://github.com/vim/vim/commit/b3030b653bbdc08c91138001d1987d804f6ebf46 Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
* build: don't allow Xcode as generatordundargoc2024-03-03
| | | | | | | | Xcode does not allow having multiple targets depend on a custom command. This limitation severely hinders its usability and complying with it would likely require extensive refactoring and boilerplate. It makes more sense to simply refer users to use "Ninja" or "Unix Makefiles" instead.
* vim-patch:e93afc2e6126Christian Clason2024-03-03
| | | | | | | | | | | runtime(r,rhelp,rmd,rnoweb,rrst): Update ftplugin, browsefilter labels (vim/vim#14126) Use the standard format for browsefilter labels: "File Description (*.ext1, *.ext2, *.ext3)" https://github.com/vim/vim/commit/e93afc2e612647e79e1082096ffd6c61e01ac691 Co-authored-by: dkearns <dougkearns@gmail.com>
* fix(column): full redraw with 'stc, 'rnu' and inserted lines (#27712)luukvbaal2024-03-03
| | | | Problem: Text is not redrawn with 'relativenumber' when only the 'statuscolumn' is redrawn after inserted lines. Solution: Force a full redraw if statuscolumn width changed.
* fix(lsp): directly rename the existing buffers when renaming (#27690)Jaehwang Jung2024-03-02
| | | | | | | | | | | | | | | | Problem: `vim.lsp.util.rename()` deletes the buffers that are affected by renaming. This has undesireable side effects. For example, when renaming a directory, all buffers under that directory are deleted and windows displaying those buffers are closed. Also, buffer options may change after renaming. Solution: Rename the buffers with :saveas. An alternative approach is to record all the relevant states and restore it after renaming, but that seems to be more complex. In fact, the older version was attempting to restore the states but only partially and incorrectly.