| Commit message (Collapse) | Author | Age |
| |
|
|
| |
Alias semantis are identical to using the full extreg name.
|
| |
|
|
| |
Add tests for aliases.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
Problem: Vim9: cannot pass "true" to timer_paused().
Solution: Use tv_get_bool(). (closes vim/vim#6891)
https://github.com/vim/vim/commit/418155def2aa45afd7fc034db341dc874b00af3a
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
|
|
|
|
|
|
|
|
| |
Problem: Vim9: cannot pass "true" to submatch(), term_gettty() and
term_start()
Solution: Use tv_get_bool_chk(). (closes vim/vim#6888, closes vim/vim#6890, closes vim/vim#6889)
https://github.com/vim/vim/commit/ad30470610e228e66afb837fdbab6bea36c43de4
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Problem: repeat() with a large number can cause an overflow
(Yuyao Jiang)
Solution: Add overflow check for the various repeat() functions.
related: vim/vim#21373
https://github.com/vim/vim/commit/70903d2be29ddf759ea55cfa6d343c026ea04779
Co-authored-by: Christian Brabandt <cb@256bit.org>
|
| |
|
|
|
|
|
|
|
|
| |
Problem:
Redundant logic.
Solution:
Deduplicate.
Also: `winrestview()` no longer forces a status-line redraw and
resending `win_pos` (`win_new_width()` on unchanged width).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
needed (#41925)
Problem: getregionpos() returns a pair of positions for every line, so
obtaining just the outer endpoints of a region costs O(lines);
for a 100000 line region that is about 1.4 million list
allocations for a result of which the caller keeps two
positions.
Solution: Add a "bounds" item to {opts} that returns a single pair with
the start on the first line and the end on the last line
(Volodymyr Chernetskyi).
The lines in between do not influence the outer endpoints, so with
"bounds" they are not visited at all. The two positions then come from
different lines and describe a diagonal of the region rather than its
shape; for a blockwise region they are the start of the first line and
the end of the last line, not the corners of the block. This is exactly
what indexing the full result gives, so the awkward corners are kept as
they are, including an empty first line yielding a "col" of 0 for the
start while the end keeps its own column.
On a 100000 line buffer this takes getregionpos() from about 45 ms to
about 0.003 ms per call.
closes: vim/vim#21209
https://github.com/vim/vim/commit/2173c3e4eceedc76c4fd7d56cdbfbbd35e9be853
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Notes:
- 8.2.1614 also flips searchcount()'s "recompute" default to FALSE;
- 8.2.1620 flips it back, so the default stays true here.
vim-patch:8.2.1601: Vim9: cannot use 'true" with garbagecollect()
https://github.com/vim/vim/commit/2df47310422f4a77e85de7901a5299923a1addd3
vim-patch:8.2.1602: Vim9: cannot use 'true" with getbufinfo()
https://github.com/vim/vim/commit/036c2cf719e3de445779a275514030be66e26883
vim-patch:8.2.1603: Vim9: cannot use "true" with getchar()
https://github.com/vim/vim/commit/c08cc72947fdfab484f53c5d9bbea662bc5a9c8f
vim-patch:8.2.1604: Vim9: cannot use "true" with getcompletion()
https://github.com/vim/vim/commit/d217a87755ba01fc626b1c178c682fcd05ab3a28
vim-patch:8.2.1614: Vim9: cannot pass "true" to searchcount()
https://github.com/vim/vim/commit/597aaac9d2b090e0eb738ab4e2afd454b7b92393
vim-patch:8.2.1615: Vim9: cannot pass "true" to searchdecl()
https://github.com/vim/vim/commit/30788d3d37a90b0702d94b7272ed26672534ba6f
vim-patch:8.2.1616: Vim9: cannot pass "true" to synID()
https://github.com/vim/vim/commit/fcb6d7082d563acc33866b3d3a659c32ad19a9e1
vim-patch:8.2.1617: Vim9: cannot pass "true" to win_splitmove()
https://github.com/vim/vim/commit/4b9bd692bdffba03fda04f9979e25431b53e416b
vim-patch:8.2.1619: Vim9: cannot pass "true" to spellsuggest()
https://github.com/vim/vim/commit/7c27f337bf278babc1ccdcb66ac975f115d660b7
vim-patch:8.2.1620: searchcount() test fails
https://github.com/vim/vim/commit/4140c4f3fff1a441f2837f2f911ab0f0368e412a
N/A patches:
vim-patch:8.2.1606: has() takes no second argument in Nvim
https://github.com/vim/vim/commit/04637e243d39f791cfc97c3ce96d99ef1bf047e1
vim-patch:8.2.1610: list2str()/str2list() take no "utf8" argument
https://github.com/vim/vim/commit/a48f786787e8e070c1a611146fd1f0f7e141e60a
vim-patch:8.2.1611: nr2char() ignores its "utf8" argument
https://github.com/vim/vim/commit/ed6a430fae72c077ec106c9620379b69cfec3035
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: string_reduce() copies *rettv into argv[0] before calling
eval_expr_typval(). When the evaluator fails early, rettv is
never reset and still aliases argv[0] v_string.
clear_tv(&argv[0]) frees it, leaving rettv dangling and when
in vim9script get_func_tv() frees it again (Ave Dva).
Solution: Set rettv->v_type = VAR_UNKNOWN like what is done in
list_reduce() and tuple_reduce(), use tv_get_string_strict()
in f_reduce()
closes: vim/vim#21048
Supported by AI.
https://github.com/vim/vim/commit/cd59994c455a20d39d5cc41b4978ecfd2bf4be2e
Co-authored-by: Christian Brabandt <cb@256bit.org>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
There is no unified notion of a "user action".
Vim processes input by one-char-at-a-time, and mostly throws away any
hints it might gather about the user's action, with one exception: it
stores the last _edit_ action (the "redo buffer", encoded as
unstructured `["x][v][count]body` bytes).
Plugins can only observe individual keys (vim.on_key) and high-level
effects (TextChanged, CursorMoved).
Solution:
- Users can subscribe to `CmdAtom` events to handle any user action.
- Event is deferred; handlers cannot cancel or interfere with user
actions.
- Capture `CmdSpec` from the normal/insert/visual subsystems.
- typeahead/readahead stay unstructured (`buffheader_T`): they are key
streams, not commands.
- the redo/record buffers become `StringBuilder`: fewer
allocations/copies.
- Repurpose the input/redo engine to accept `CmdSpec` objects.
"atom": one repeatable unit of user input, as a resolved (post-mapping)
keysequence plus structured fields. Only user actions, not `:normal`,
API calls, or non-"t" `feedkeys`.
BREAKING: dot-repeat of an Insert session, replays the entire session
including cursor-moves (:help ins-repeat).
BREAKING: dot-repeat of a Visual operation, replays the selection
instead of operating on a fixed-size region.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Now this was a cargo cult anti-pattern to write home about.
Doing painful save-and-restore bookkeeping around a separate
`magic_overruled` decoy global is just as messy as doing painful
save-and-restore logic around `p_magic` itself. only that now you need
to wrap every access to the effective value in a function call.
This replaces this with a marvellous new Clean Code technique™:
passing in the intended behavior as a function parameter to functions
where either the option or an explicit value might be used.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: The channel source file is too big.
Solution: Move job related code to a new source file.
----
Move eval-related prompt-buffer API to src/nvim/nvim/eval/buffer.c.
https://github.com/neovim/neovim/pull/37743#issuecomment-3897416840
----
https://github.com/vim/vim/commit/8b5866ded6036f7adece26b6d16962bbd2d47842
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
|
|
|
|
|
|
|
| |
Problem: Vim9: index() does not take "true" as argument.
Solution: Use tv_get_bool_chk(). (closes vim/vim#6823)
https://github.com/vim/vim/commit/6c553f9c04a698ac2e19584f8ea8e2cb7cd98c80
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
|
|
|
|
|
|
|
| |
Problem: Vim9: getreg() does not take "true" as argument.
Solution: Use tv_get_bool_chk(). (closes vim/vim#6820)
https://github.com/vim/vim/commit/67ff97ded70a87bc77f58d0bf9a261710ae88112
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
|
|
|
|
|
|
|
| |
Problem: Vim9: expand() does not take "true" as argument.
Solution: Use tv_get_bool_chk(). (closes vim/vim#6819)
https://github.com/vim/vim/commit/551d25e76545df785a9f62df52f34bc1dd368bfb
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
|
|
|
|
|
|
|
|
| |
#41216
Problem: Vim9: error when passing getreginfo() result to setreg().
Solution: Use dict_get_bool() for "isunnamed". (closes vim/vim#6784)
https://github.com/vim/vim/commit/6a950581da52b410a74531044aae8f1f8f38a7df
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
The object subsystem has an intermediate representation for no real
reason. Besides the code cost, this also adds an extra (api <=> OptVal)
conversion step, which is a (small) perf cost.
Solution:
We already have `Object`, so use it instead.
- drop `OptVal`, `OptValData`, `OptValType`, and related boilerplate.
- add `kObjectTypeUnset`.
|
| |
|
|
|
|
|
|
|
|
| |
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:
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:
- `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`.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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:
bufwrite message overridden by :redrawstatus command within Progress callback.
Solution:
- don't use globally-shared IObuf.
- use vim_snprintf to deduplicate `nlua_call_luaeval`, `nlua_call_vlua`.
fix https://github.com/neovim/neovim/issues/40616
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
cmdwin (the `:q` cmdline buffer) has various limitations which require
special-casing all over the codebase.
Besides complicating the code, it also breaks async plugins if they try
to create buffers/windows after some work is done, if the user happens
to open cmdwin at the wrong the moment:
Lua callback: …/guh.nvim/lua/guh/util.lua:531:
E11: Invalid in command-line window; <CR> executes, CTRL-C quits
stack traceback:
[C]: in function 'nvim_buf_delete'
…/guh.nvim/lua/guh/util.lua:531: in function <…/guh.nvim/lua/guh/util.lua:526>
Solution:
Just say no to "inception". Reimplement cmdwin as a normal buffer+window.
All of the cmdwin contortions (in both core, and innocent plugins) exist
literally only to support "inception": recursive
cmdwin-in-cmdline-things, like `<c-r>=`, `/`, search-during-substitute,
`:input()`, etc. So we just won't support that (though I have
a potential plan for that later, which I call "modal parking lot").
The benefit is that plugins, and core, no longer have to care about
cmdwin.
BONUS:
- mouse-drag on vertical separators works (it only worked for
horizontal/statusline before)
- inccommand-in-cmdwin now works correctly, for free (thus don't need
#40077).
POTENTIAL FOLLOWUPS
- Drop `CHECK_CMDWIN` ("E11: Invalid in command-line window"), allow chaos.
- Unify `BUFLOCK_OK` / `LOCK_OK` ?
DESIGN:
- Eliminate lots of C globals, `EX_CMDWIN`, etc.
- `text_locked()` no longer reports true for cmdwin.
- cmdwin = a normal window with 'winfixbuf', 'bufhidden=wipe',
'buftype=nofile'. Invariants come from those options rather than
special cases throughout the codebase.
- `nv_record` for q:/q//q? calls Lua
`nlua_call_vimfn("vim._core.cmdwin", …)`. No `K_CMDWIN`
/ cmdline-reader detour.
- `cedit_key` (`c_CTRL-F`) schedules a deferred event that calls
`vim._core.cmdwin.open(type, content, pos)` and returns `Ctrl_C` so
the in-flight cmdline cancels. Reader state is not serialized; instead
the captured `(type, line, col)` is replayed via
`nvim_feedkeys(type..line.."<CR>", "nt", …)` after user confirms.
- On confirm/cancel: `<CR>` / `<C-C>` calls into Lua which closes the
window and re-feeds the cmdline.
BREAKING CHANGES:
- Expression-register cmdline (`<C-R>=` from insert-mode) no longer
supports cmdwin. Same applies to `input()` / `inputlist()` (already
covered by `text_locked`).
- Usage of cmdwin in macros/mappings will probably break (assuming they
ever worked).
|
| |
|
|
|
|
|
|
|
|
|
| |
Problem:
- Transient mutation of the parent env is visible to any concurrent
code. Or at least just kinda sloppy.
- Latent bug:`channel_job_start` queues the spawn and returns before
`uv_spawn` runs, so the prior `os_unsetenv` immediately after the call
could in principle race with the deferred spawn.
Solution:
Pass `env` to the channel.
|
| |
|
|
|
|
|
|
|
|
|
| |
Problem: Vim9: null value tests not sufficient
Solution: Add a more comprehensive test for null values
(Yegappan Lakshmanan)
closes: vim/vim#14701
https://github.com/vim/vim/commit/da9d345b3dd8fe67c0c7341e426b09bec8c40abd
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Problem:
followup to 55ceb314ca96 #39478
`:oldfiles` and swapfile `:recover` do not delegate to `vim.ui.select`.
Solution:
- Delegate to `vim.ui.select`.
- Fix a long-standing `recover_names` bug where `concat_fnames(dir_name,
files[i], true)` produced malformed `<dir>//<dir>/<file>` paths (also
fixes `swapfilelist()`).
|
| | |
|
| |\ |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
dicts (#39237)
Problem: too many strlen() calls when adding strings to dicts
Solution: Refactor code to use string_T, use dict_add_string_len()
instead of dict_add_string() (John Marriott)
Additionally:
- In textprop.c, in function prop_fill_dict() use a string_T to store
local variable text_align.
- In popupwin.c, use a string_T to store struct member pp_name in struct
poppos_entry_T.
- In mark.c, refactor function add_mark() to pass in the length of
argument mname.
- In insexpand.c:
->Use a string_T to store the elements of static array
ctrl_x_mode_names.
->Refactor function trigger_complete_done_event():
->->change type of argument char_u *word to string_T *word.
->->make one access of array ctrl_x_mode_names instead of two.
->Refactor function ins_compl_mode() to accept a string_T to return the
resulting string.
- In fileio.c:
->Refactor function getftypewfd() to accept a string_T to return the
resulting string.
->In function create_readdirex_item() use a string_T to store local
variable q.
- In cmdexpand.c, store global cmdline_orig as a string_T.
- In autocmd.c, in function f_autocmd_get() use a string_T to store local
variables event_name and group_name. Measure their lengths once when
they are assigned so they are not remeasured on each call to
dict_add_string() in the subsequent for loop.
- In channel.c, in function channel_part_info() drop local variable status
and use s instead. Make s a string_T.
closes: vim/vim#19999
https://github.com/vim/vim/commit/c13232699db413e735f30b5649c78a7f38a9a069
Co-authored-by: John Marriott <basilisk@internode.on.net>
|
| |/
|
|
|
|
|
|
| |
Problem: Using execute() to define a lambda doesn't work. (Ernie Rael)
Solution: Put the getline function in evalarg. (closes vim/vim#10375)
https://github.com/vim/vim/commit/a7583c42cd6b64fd276a5d7bb0db5ce7bfafa730
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
|
|
|
|
|
|
|
|
| |
Crash on
```
let busy=$FOO
call prompt_setcallback(bufnr('%'), $FOO)
call chanclose(1, $FOO)
```
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
Problem:
Too much boilerplate needed to use Lua to impl an excmd or f_xx
function.
Solution:
- Add `nlua_call_vimfn` which takes the args typval, executes
Lua, and returns a typval.
- refactor(excmd): lua impl for :log, :lsp
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
- Builtin "Vimscript" functions (f_xx) are mostly implemented in C.
Partly that's because there is some boilerplate required to call out
to Lua.
- Calls to `vim.fn.foo()` always marshall over the Lua <=> Vimscript
("typval") bridge, even if `fn.foo()` is implemented entirely in Lua:
```
Lua => typval => Object => Lua => Object => typval => Lua.
```
Solution:
Functions declared in eval.lua with `func_lua` are implemented in
entirely in Lua (`_core/vimfn.lua`).
- `gen_eval.lua` wires `func_lua` entries to `lua_wrapper`, which handles
the typval conversion for Vimscript callers (slow path).
- `nlua_call()` detects `func_lua` functions and calls the Lua
implementation directly. This eliminates all conversion overhead for
Lua callers (fast path).
- Validate at build-time that `func`, `func_float`, and `func_lua` are
mutually exclusive.
- Migrate `hostname()` as a toy example, to show the idea.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: repeat_string() can be improved
Solution: Replace the for() loop by an exponential growing while loop
(Yasuhiro Matsumoto)
closes: vim/vim#19977
https://github.com/vim/vim/commit/bfa46a52f6a93cb99ec55d56ad43493d875c6dc2
Cherry-pick f_repeat() refactor from patch 9.1.1232.
Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
| |
|
|
|
| |
Problem: e_invalwindow was a static local, inconsistent with other error strings.
Solution: Convert it to EXTERN/INIT style and move it to errors.h.
|
| |
|
|
|
| |
- `src/nvim/ex_cmds_defs.h`: use "U" instead of "u" per
`readability-uppercase-literal-suffix`
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
(#38749)
Problem: 'linebreak' may lead to wrong Visual block highlighting when
end char occupies multiple cells (after 7.4.467).
Solution: Exclude 'linebreak' from the ending column instead of setting
'virtualedit' temporarily (zeertzjq).
fixes: vim/vim#19898
closes: vim/vim#19900
https://github.com/vim/vim/commit/23be1889d1a1212445ca8bb9cd378484d3755f79
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
The "restart" event has some problems:
- all UI clients must implement a somewhat complex set of setups
- UI must be on the same machine as the server
- only works for the "current" UI
- race/edge case: If the user config has errors / waiting for input, are
all UIs able to attach while Nvim is waiting for input?
Solution:
- Perform the restart on the server, not the client.
- Pass listen address (instead of CLI args) in the UI event.
- Simplifies UI logic: they only need to attach to new address.
- Opens the door for more enhancements in the future, such as allowing
all UIs to reattach instead of only the "current" UI.
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
The 'android' and 'termux' feature flags have been shipped in the
downstream neovim/neovim-nightly package for 5+ years but were never
properly documented in the downstream patch.
Solution:
Upstream the 'android' and 'termux' feature flags into Neovim as
decoupled feature flags, this enables the 'android' feature in
particular to be available independently of the 'termux' feature
for builds of Neovim against the Android NDK, but not including
the Termux NDK patchset.
Co-authored-by: Lethal Lisa <43791059+lethal-lisa@users.noreply.github.com>
Co-authored-by: shadmansaleh <13149513+shadmansaleh@users.noreply.github.com>
|