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.
Problem:
URI buffer names can end with a slash, but slash-ended directory
matching should not preempt URI filetype patterns.
Solution:
Do not use the slash shortcut for names with URI schemes, so those
continue through normal filetype matching.
Co-authored-by: Adam Karafyllidis <akisarou90@gmail.com>
FAILED 2 tests, listed below:
FAILED …/lua/system_spec.lua:124: …/lua/system_spec.lua @ 44: vim.system (async) supports timeout
…/lua/system_spec.lua:124: …/lua/system_spec.lua:44: process still exists
stack traceback:
D:/a/neovim/neovim/test/functional/testnvim/exec_lua.lua:124: in function 'system'
…/lua/system_spec.lua:124: in function <…/lua/system_spec.lua:118>
FAILED …/lua/system_spec.lua:111: …/lua/system_spec.lua @ 22: vim.system (sync) can set environment with clear_env = true and env = nil
…/lua/system_spec.lua:111: …/lua/system_spec.lua:22: process still exists
stack traceback:
D:/a/neovim/neovim/test/functional/testnvim/exec_lua.lua:124: in function 'system'
…/lua/system_spec.lua:111: in function <…/lua/system_spec.lua:97>
Problem:
unreliable test:
FAILED …/tui_spec.lua @ 895: TUI mouse events work with right-click menu (escape sequences sent to child)
D:/a/…/testnvim.lua:144: Vim:Failed to start server: address already in use
stack traceback:
D:/a/…/testnvim.lua:144: in function 'eval'
D:/a/…/testnvim.lua:1015: in function 'new_pipename'
…/tui_spec.lua:897: in function <…/tui_spec.lua:895>
Solution:
Workaround potential PID reuse.
Problem: nvim_cmd() accepts number/boolean in args and converts them
to strings, but the keyset declares ArrayOf(String).
Solution: use ArrayOf(Union(Integer, String, Boolean)) and wrap union
types in parens when generating array annotations.
Problem:
Changing global 'winbar' only updates window layout state in the current
tabpage. This means existing hidden tabs can keep stale winbar height.
Solution:
Recompute winbar state for all tabpages on global `'winbar'` changes.
Problem:
`vim.filetype.match()` needs a cheap way to recognize directory buffers
without doing filesystem stat work.
Solution:
Ensure full buffer names for directories end in a trailing slash. Now
directory buffers can proceed through the normal 'filetype' path.
Note side-effects: session and ShaDa buffer-list restore behavior must
be compatible, so those + corresponding tests must be updated.
unify context-switching logic.
1. `prevwin` is now restored for all targets (was buf-only).
- add a `nvim_win_call` test.
2. The buf-found "restore the shown buffer" dance no longer depends on
the origin window: it runs even if the callback closed the origin.
Problem:
`screen:expect({none=…})` with no any/grid crashed (concat on nil)
because actual_rows was only rendered when any or grid was present.
Solution:
Update the condition.
Problem:
A `--listen` path longer than the system socket path limit (~104 bytes on
macOS, 108 on Linux) is silently truncated by `uv_pipe_bind()`. Nvim either
serves a socket at a different path than `v:servername` reports, or fails with
an error that blames the full untruncated path (confusing):
nvim: Failed to --listen: address already in use: "<full path>"
Steps to reproduce:
$ nvim --listen /var/folders/g7/9y_ydbnj2fs_fvp8xf44p8gc0000gn/T//nvim/-Users-rpatterson-Projects-src-github.com-neovide-neovide --embed -p
nvim: Failed to --listen: address already in use: "/var/folders/g7/9y_ydbnj2fs_fvp8xf44p8gc0000gn/T//nvim/-Users-rpatterson-Projects-src-github.com-neovide-neovide"
$ ls /var/folders/g7/9y_ydbnj2fs_fvp8xf44p8gc0000gn/T//nvim/-Users-rpatterson-Projects-src-github.com-neovide-neovide
"/var/folders/g7/9y_ydbnj2fs_fvp8xf44p8gc0000gn/T//nvim/-Users-rpatterson-Projects-src-github.com-neovide-neovide": No such file or directory (os error 2)
$ ls -l /var/folders/g7/9y_ydbnj2fs_fvp8xf44p8gc0000gn/T//nvim/
srwxr-xr-x@ - rpatterson 31 Mar 10:24 -Users-rpatterson-Projects-src-github.com-neovid
Solution:
Bind with `uv_pipe_bind2()` and `UV_PIPE_NO_TRUNCATE` (libuv 1.46+), so
a too-long path fails up front with the actual reason:
nvim: Failed to --listen: invalid argument: "<full path>"
Problem:
`magic` was owned by `CmdParseInfo`, but command handlers
need it at execution time via `exarg_T`.
Solution:
Move `magic` into `exarg_T`, and initialize it in `parse_cmdline()`.
Problem: No concise way to execute a callback with temporarily set
working directory. This might be useful when sourcing nested files to
allow them to assume that current working directory is their root
directory.
Solution: Add `cwd` context to `vim._with().`
Problem: The default 'packlockfile' value doesn't respect $NVIM_APPNAME.
Solution: Use more direct way of setting the default value, following
the example of other options with a similar behavior.
Problem: when an LS client detaches from the buffer, only pull diagnostics
are cleared via capability framework. Push diagnostics remain stuck even
when client stops/restarts.
Solution: clear push diagnostics on client detach.
ref #33864