Problem:
w_float_is_info conflates a window's role with its floating layout,
which are orthogonal properties.
Solution:
Replace w_float_is_info with a w_kind enum for the window's role.
Problem: ml_get error when changing hidden buffer in Python.
Solution: Block updating folds. (closesvim/vim#7598)
----
"ctx_switch()", "ctx_restore()" obsolete "switch_buffer()" and
"restore_buffer()".
Latter are unused since https://github.com/neovim/neovim/pull/15831.
Mark them as N/A (until some test fails).
----
3e0107ea16
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problems:
On Windows, `:w somedir` (where somedir is an existing directory
in pwd) shows the misleading `E13: File exists (add ! to override)`
instead of `E17: "somedir" is a directory`.
Solution:
drop unnecessary `#ifdef` guard.
Problem: when PR #40621 removed a 50 cell restriction to item group
minwid, a possible integer overflow was introduced when the added
padding is multiplied with the number of fillchar bytes.
Solution: when there is not enough buffer capacity left, reduce the
number of added fillchars before calculating the number of added bytes.
Problem:
nvim_create_autocmd() isn't |api-fast|, so modules that create autocmds
(e.g. vim.treesitter.query) can't be require()d in a fast event context.
Solution:
Mark it |api-fast|. Compile autocmd patterns with RE_NOBREAK so
aucmd_next() won't os_breakcheck() mid-iteration, where a fast
nvim_create_autocmd() could realloc the autocmds vector and dangle the
caller's AutoPat/AutoCmd.
RE_NOBREAK is low-risk because:
- aucmd_next()'s loop checks CTRL-C: `(for (… i < apc->ausize && !got_int; …)`.
- `line_breakcheck()` (`autocmd.c:1912`) runs once per matched autocmd.
- Each autocmd _execution_ runs through `do_cmdline`, which has its own
breakchecks.
However this does admit risk of a pathological case:
a catastrophic-backtracking glob matched against a very long `User`
event-pattern.
Co-authored-by: Riley Bruins <ribru17@hotmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Problem:
Float border highlight groups (FloatBorder, FloatTitle and FloatFooter)
fall back to Normal background highlight if no background color set.
Solution:
Combine border colors with window-local Normal highlight.
Fix#38330
vim-patch:8.2.4945: inconsistent use of white space
vim-patch:9.0.1590: filetype test has trailing white space
vim-patch:9.0.1916: Crash when allocating large terminal screen
vim-patch:d086b8f64 runtime(doc): fix inconsistent indent (#14089)
vim-patch:59356019e runtime(doc): align command line table
vim-patch:112505104 runtime(doc): CI: remove trailing white space in documentation
vim-patch:3ca914ec7 runtime(doc): Tweak documentation style a bit
vim-patch:9.1.1352: style: inconsistent indent in insexpand.c
vim-patch:9.1.1363: style: inconsistent indentation in various files
vim-patch:9.1.1366: v9.1.1364 unintentionally changed sign.c and sound.c
vim-patch:45b59a92c runtime(doc): remove trailing whitespace from example in builtin.txt
vim-patch:9.2.0003: tests: invalid indent in message.c
vim-patch:467fe6581 CI: Bump the github-actions group across 1 directory with 2 updates
vim-patch:9.2.0798: Memory leak in compile_expr6() on alloc failure
vim-patch:9.2.0799: Memory leak in compile_def_function_body() on alloc failure
Co-authored-by: marvim <marvim@users.noreply.github.com>
Problems:
1. Can't get individual parts of a key-chord separately: modifiers, key.
2. Can't separate a key-combo into individual key-chords.
Solution:
Enhance `vim.keycode()` to optionally return a structured parse result
as a list of key-chords:
- `key_raw` the key-chord (problem 2)
- `mod` the modifiers of `key_raw` (problem 1)
- `key_orig` the key part of the key-chord, only here if differing from `key`
(this doesn't solve any of the above mentioned problems, but it may provide
useful and it's (in terms of code) free)
- `key` a normalized version of `key_orig` (solving problem 1), example(the
first is `key_orig` and second is `key`): `lt` and `<`, `Bar` and `|` (in
`<C-Bar>`)
Problem: Visual block reselection wrong with 'virtualedit' when line
lengths are different (Alex Yang, after 8.2.3494).
Solution: Set the entire cursor position to old position when computing
target curswant, since the check_cursor() added in 8.2.3494
may change cursor column as well (zeertzjq).
fixes: vim/vim#20746closes: vim/vim#207488cddbfe468
Problem: extend() and extendnew() don't handle NULL expr2 properly
(Mao-Yining)
Solution: Still set the return value when expr2 is NULL (zeertzjq).
fixes: vim/vim#20758closes: vim/vim#20759e397c82a04
vim-patch:98056533b Vim 8.2 release
vim-patch:495282b6e Correct list of patch numbers
vim-patch:85d9b03f8 Correct list of patches.
vim-patch:8.2.2598: Vim9: :open does not need to be supported
vim-patch:8.2.4606: test fails because of changed error message
vim-patch:9.0.0014: missing part of the test override change
vim-patch:9.0.0515: virtual text highlight starts too early when 'number' is set
vim-patch:9.0.0516: virtual text "above" highlights gap after it
vim-patch:9.0.0518: virtual text highlight starts too early with 'nowrap'
vim-patch:9.0.0698: VisVim is outdated, does not work with current Visual Studio
vim-patch:9.0.0833: Mac: no +sound feature in huge build
vim-patch:9.0.1124: virtual text at a column position is truncated
vim-patch:9.0.1463: virtual text truncation only works with Unicode 'encoding'
vim-patch:9.0.1482: crash when textprop has a very large "padding" value
vim-patch:9.0.1695: Crash with overlong textprop above
vim-patch:9.1.0139: MS-Windows: ligatures map cleared on startup
vim-patch:9.1.0368: MS-Windows: Hard to define the Vim Patchlevel with leading zeroes
vim-patch:20393bc02 runtime(doc): update last change date for diff.txt
vim-patch:c49cb93a8 patch 9.1.1392: missing patch number
vim-patch:9.1.1397: tabpanel not correctly updated on :tabonly
vim-patch:9.1.1530: Missing version change in v9.1.1529
vim-patch:689f3bf31 runtime(doc): clarify C99 constraints and portability assumptions
vim-patch:9.1.1589: Cannot disable cscope interface using configure
vim-patch:9.1.1637: FEAT_DIFF used in diff.pro
vim-patch:2d4eb6ee1 runtime(doc): Remove dead link from todo.txt
vim-patch:6d8307fc2 runtime(doc): Add a Development policy
vim-patch:9.1.1982: Use after free with redraw_listener_add()
vim-patch:9.1.2084: Compile error when build with job feature
vim-patch:9.1.2115: CI: wrong preprocessor indentation
vim-patch:9.2.0764: Compiler warning about unused function
vim-patch:b212f440a CI: Bump the github-actions group across 1 directory with 2 updates
Co-authored-by: marvim <marvim@users.noreply.github.com>
Problem:
urxvt doesn't support resetting to default cursor style like we assumed.
https://github.com/neovim/neovim/issues/38987#issuecomment-5004636437
Solution:
Instead of the reset sequence, always set it to steady block. This will
still be wrong for users who configured their initial cursor to
underline, but it's about the best we can do.
Problem:
`nvim__ui_detach` was added in 85e0559d46 in order to implement
`detach_others` from Lua. Using Lua in this case is doing more harm than
good.
Solution:
Extract `ui_detach_channel`, which also allows it to be used for the
"self detach" path from `ex_detach`.
Bonus: the old MSWIN path always called `os_swap_to_hidden_console()`;
now `ui_detach_channel` only does so for a stdio channel. For the common
stdio TUI this is identical; for a socket UI it's more correct (no
parent console to swap).
Problem:
Expanding an unknown ~user path falls back to the shell. In a fast event,
this re-enters the event loop and aborts Nvim.
Solution:
Leave unknown users unexpanded when the system account lookup fails.
Problem: #40731 may still crash if close_buffer autocmds reinsert the float's
grid. Plus removing the grid (and posting win_close) is unneeded if
win_close_othertab refuses to close the window later, which is possible.
Solution: do the stuff before freeing the window, like win_close.
Problem: LSP completion commitCharacters are not handled. Typing a
commit character (e.g. `.`, `(`, `;`) while a completion item is
selected does not accept the item first.
Solution: Store commit characters as a flat string in complete-items.
Check it before completion stops, accept the match and let
the character be inserted normally.
Problem: Closing a floating window from a non-current tab frees its grid
without removing it from the compositor's `layers` table, so the next
`ui_comp_put_grid()` walks a dangling pointer (UAF).
Solution: Call `ui_comp_remove_grid()` (and `ui_call_win_close()` for
multigrid UIs) before `win_free_mem()`, matching `win_close()` since
PR #21551.
Problem:
- No UI for listing extmarks.
- `:marks` doesn't support cmdline-completion.
Solution:
- Add completion and extmarks support to `:marks`.
- Update `get_buf_local_marks` to include the ":" (prompt-buffer) mark.
Problem:
This functions are most likely never used in the wild.
- They are redundant with `nvim_get_context` + `nvim_load_context`.
- The "context" concept was never fully developed and hasn't gained
traction.
Solution:
Drop these vimscript aliases, they are just extra cruft.
Problem:
`FileType directory` fires *before* the `BufEnter` path where `dir.lua`
populates the buffer, in order to allow a 3P dir-browser plugin to handle the
event and (optionally) rename the buffer to e.g. `example:///tmp/foo/`.
But currently, `open_buffer()` continues after `filetypedetect BufRead` as if
the original directory buffer is *still* current and valid, which may fall
through to the built-in `nvim.dir` path after a 3P plugin ALREADY handled the
directory.
Solution:
Keep a buf ref around the early `filetypedetect BufRead` call for directory
buffers.
If the `FileType directory` handler switches away from/deletes the original
directory buffer, stop the open path instead of continuing into the built-in
`nvim.dir` flow.
Problem:
A successful `BufReadCmd` can leave an existing `filetype` without
rerunning its `FileType` setup, so state cleared during reload may not
be restored.
This also causes `:edit`/reload syntax `directoryDirectory` groups to
not be reapplied.
Solution:
After `BufReadCmd` handles a read, trigger `FileType` for the existing
`filetype` if no `FileType` event fired during the read.
Problem:
Insert-mode globals are scattered.
Solution:
Group them into one struct. Besides improving readability and
discoverability, this greatly helps with save/restore of an insert-mode
session.
Problem:
Continue separators normalization, and try to keep it at the
nvim <-> external boundary, e.g., `fn.xxx`, `api.xxx`, `:xxx`
Solution:
some key changes
- normalize `$HOME-windows`
- normalize entry points of changing directory
- `nvim_set_current_dir()`, `chdir()`
- normalize the named pipe
- `--listen` arg, `--server` arg, `:restart`
- `serverstart()`, `sockconnect()`, `serverstop()`
- make `expand()` respect 'shellslash' again
- clean up `did_set_shellslash`
- replace `forward_slash` with `TO_SLASH`
- remove obsolete `TMP_PATHSEPSTR`
- remove `slash_adjust` in `do_autocmd_dirchanged`?
- make `fnamemodify()` always return `/` (except when substituting
separators via `:s`, `:gs` ?)
Note:
- these funcs still apply `slash_adjust` on return, as before:
`:pwd`, `chdir()`, `exepath()`, `getcwd()`
- these funcs alwarys return `/`, unlike before the normalization PRs
- `getcompletion()`, `finddir()`, `findfile()`
Also
- clean up code, comments, formatting and tests
- move `TO_SLASH` from `f_chdir` to `changedir_func`
- move `TO_SLASH` from `f_bufadd` to `buflist_new`
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Problem: When a split window is created from the init script using nvim_open_win()
with enter=false, the current window focus is not preserved. The cursor
incorrectly moves into the newly created split during startup.
Solution: Save curwin before the iteration loop in create_windows(), and
restore it after the loop. also update edit_buffers() to use curwin instead
of firstwin.
Problem:
- `edit.c` is an unnecessarily misleading and less-discoverable name
than `insert.c`.
- Numerous insert-mode related things are named with a `ins_` prefix.
- There is already a `insexpand.c` module...
Solution:
Rename `edit.c` => `insert.c`.
CID 649145: Error handling issues CHECKED_RETURN
/src/nvim/api/window.c: 138 in nvim_win_set_cursor()
132 // Make sure we stick in this column.
133 w->w_set_curswant = true;
134
135 // make sure cursor is in visible range and
136 // cursorcolumn and cursorline are updated even if w != curwin
137 CtxSwitch switchwin;
>>> CID 649145: Error handling issues (CHECKED_RETURN)
>>> Calling "ctx_switch" without checking return value (as is done elsewhere 5 out of 6 times).
138 ctx_switch(&switchwin, w, NULL, NULL, kCtxNoEvents | kCtxNoDisplay);
139 update_topline(curwin);
140 validate_cursor(curwin);
141 ctx_restore(&switchwin);
142
143 redraw_later(w, UPD_VALID);
Problem:
`getchar.c` is a quirky name and doesn't align with our existing
`os/input.c` and `tui/input.c` modules, which encompass the same topic
at different layers.
Solution:
Rename `getchar.c` => `input.c` for discoverability.
Introduce `dialog.c` for functionality related to showing confirm
prompts, dialogs, etc.