| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
|
|
|
|
|
| |
Problem:
'isident' decides how env var names are parsed, which is more
"confusing" than "useful":
- Changing 'isident' (for 'define' or "\i") can break `$NAME` expansion.
- Its default byte ranges let multibyte names work on Windows (`$aあ`)
but not Unix (`$é`).
Solution:
Ignore 'isident' when parsing env var names.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
'isident' is checked per byte (inherited from Vim), so a name can end
in the middle of a multibyte char: with "192-255", `$é` (C3 A9) looks
up "\xC3".
- Unix: expands an env var named "\xC3", plus a stray "\xA9".
- Windows: uv_os_getenv() rejects the name (invalid UTF-8), and
os_getenv() logs an error.
`$VAR` in expressions (get_env_len()) and cmdline completion have the
same scan.
Solution:
`vim_isIDp()`: a multibyte char is an identifier char only if it is valid
UTF-8 and 'isident' has all its bytes. Use it in expand_env_esc(),
get_env_len() and cmdline completion. Names whose bytes are all in
'isident' still work, e.g. `$aあ` with the Windows default.
Assert UV_EINVAL in os_getenv() and os_getenv_buf() (like
os_env_exists() and os_setenv() already do): Nvim no longer passes
invalid UTF-8.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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: true and false not recognized in Vim9 script.
Solution: Recognize true and false.
https://github.com/vim/vim/commit/5d2eb0fff0fbe905da2c57fd73f7f127a73d1c99
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
Numerous callers have to manually check optval ownership (i.e. whether,
and how, to release) via `is_callback_option`, `option_is_global_local`,
etc. This is fragile, hard to use correctly; and if we introduce another
optval variant in the future, we'll have to redo all of these careful
checks and boilerplate again.
Solution:
Provide a unified system and use it everywhere:
optval_free_owned
optval_is_owned
optval_own
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
Cannot assign Lua functions/closures to "func" ('completefunc',
'tagfun', …) or "expr" ('foldexpr', 'indentexpr', …) options.
Solution:
- Store "func"/"expr" options as `Callback` instead of string.
- Delete oceans of copy-pasted code.
- BREAKING: LuaRef returned via RPC/Vimscript is now represented as
`"<Lua N: file:line>"` (like what `:map` shows) instead of `nil`.
- Note: `man.vim` still uses `v:lua` string, bc it's a vimscript ftplugin.
Helped-by: Lewis Russell <lewis6991@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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:
POSIX-compatible Ex-mode requires special-cases all over the codebase to
match various quirks that don't actually matter to users.
- The main utility of *interactive* Ex-mode is its REPL behavior, and
that can be achieved with `cmdwin`, which also gains extra UX
benefits.
- The main utility of *non-interactive* `nvim -es` is for shell
scripting, where Ex-mode quirks are mostly unhelpful (e.g. the
"Entering Ex mode" message).
Solution:
- Reimplement *interactive* Ex-mode as a "persistent, insert-mode
cmdwin" in Lua.
- "nvim -e/-E" is simply an alias to "gQ".
- Reframe *non-interactive* Ex-mode (`nvim -es`) as "script mode".
- Drop POSIX Ex-mode quirks.
Improvements:
- "nvim -V1 -es" output ends with a final newline!
- "nvim -V1 -es" no longer shows the "Entering Ex mode" msg. (This was
pointless noise, unwanted for scripting purposes.)
- stdin is no longer typeahead. Scripts (":lua io.read()") can read
stdin as data.
- Empty line is a no-op: a stray blank line no longer moves the cursor
(deviates from POSIX ex "+1"), no longer exits 1 at EOF (E501).
Preserved behavior:
- cursor starts at "$"
- mode()=="cv" (for non-interactive)
- multiline commands (:append/:function/heredoc pull continuation lines)
- bare-range print
- :print=>stdout
- -V1=>stderr
- CRLF input
- continue-after-error and exit codes
Dropped (regressed) POSIX behavior (non-interactive):
- Event loop only ticks while/between commands, not while blocked
waiting for a stdin line.
- ":g/pat/visual...Q"
- input()/getchar()/":s/x/y/c" no longer consume stdin lines as
answers: Nvim stops at end-of-input, skipping the rest of the script,
exit 0. Use ":lua io.read()" instead.
- If users care about this they should use interactive Ex-mode (`gQ`).
- ":@r" stops at end of the register instead of continuing to read
cmdline input from stdin.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
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`.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new lua based runner replaces Makefile, runnvim.sh and runnvim.vim
As it happens, we run a `--headless` nvim inside a `:terminal` layer,
this is pointless.
Also there is still a lot remnants for oldesttests, but we don't
have any except for test1.in which just checks the environment
for following, nonexistant oldesttests. so just skip that.
For now, the actual vimscript code which runs in vim-under-test is
completely unchanged.
On macos, luajit is finally working with the latest ziglua master.
Also fix some minor bugs regarding locales, such as incorrect
HAVE_WORKING_LIBINTL checks
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
There is a lot of overlap between terminal and prompt buffer, but no
easy way to limit the number of lines kept above the prompt to prevent
performance and other issues. This is desirable for both example
use cases in current documentation, chat UI and repl/shell plugins.
Solution:
Use existing 'scrollback' option to limit prompt-buffer lines
as well.
Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
|
| |
|
|
|
|
|
|
| |
Problem: vim.ui_attach() callback for nvim_echo() call that spoofs an
internal message kind is executed in fast context.
Solution: Set msg_show callback |api-fast| context dynamically at
external message callsites, and for internal list_cmd",
"progress" and "shell*" messages.
|
| |
|
|
|
|
| |
Problem: Message redirection column for captured output is not reset
after :echon since (4260f73, e63346df).
Solution: Ensure msg_ext_append is set before the kind with :echon.
|
| |
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
| |
- `src/nvim/ex_cmds_defs.h`: use "U" instead of "u" per
`readability-uppercase-literal-suffix`
|
| |
|
|
|
|
|
|
|
|
|
| |
Problem:
Currently, we recommend always inserting text above prompt-line in
prompt-buffer. This can be done using the `:` mark. However, although
we recommend it this way it can sometimes get confusing how to do it
best.
Solution:
Provide an api to append text to prompt buffer. This is a common
use-case for things using prompt-buffer.
|
| |
|
|
| |
Problem: No empty msg_show event for :echo without arguments.
Solution: Emit empty msg_show event when :echo is invoked without arguments.
|
| |
|
|
|
|
|
|
|
|
|
| |
Problem: concatenating strings is slow
Solution: Use grow_string_tv() to grow the existing string buffer in
place when possible (Yasuhiro Matsumoto).
closes: vim/vim#19642
https://github.com/vim/vim/commit/16d421a4d95b45ebbcf47ab60173cdb1b87ce419
Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: eval_addblob() is inefficient
Solution: Replace per-byte ga_append() loop with a single ga_grow() and
mch_memmove() for each source blob. This eliminates N grow
checks and function call overhead for blob concatenation
(Yasuhiro Matsumoto).
closes: vim/vim#19494
https://github.com/vim/vim/commit/c389ae8c4467e93827a9737abd907ebc27b998b3
Omit the pointless int -> long changes in other functions.
Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Problem: Setting a byte in a blob, accepts values outside 0-255
Solution: When setting a byte in a blob, check for valid values
(Yegappan Lakshmanan)
closes: vim/vim#18870
https://github.com/vim/vim/commit/f4a299700e211a728f0f7398eb8fceaf44165711
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
Problem:
Currently, if prompt gets changed during user-input with
prompt_setprompt() it only gets reflected in next prompt. And that
behavior is not also consistent. If user re-enters insert mode then the
user input gets discarded and a new prompt gets created with the new
prompt.
Solution:
Handle prompt_setprompt eagerly. Update the prompt display, preserve user input.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: Newlines intended to write messages below the cmdline or to
mark the start of a new message on message grid are emitted
through ext_messages. This results in unnecessary newlines for
a UI that has decoupled its message area from the cmdline.
msg_col is set directly in some places which is not transmitted
to msg_show events.
Various missing message kind for list commands.
Trailing newlines on various list commands.
Solution: Only emit such newlines without ext_messages enabled.
Use msg_advance() instead of setting msg_col directly.
Assign them the "list_cmd" kind.
Ensure no trailing newline is printed.
|
| |
|
|
|
|
|
| |
problem: currently when empty string is set as prompt the prompt-mark
column doesn't update.
solution: ensure the column is reset to 0 when starting prompt buffer and
before creating a new prompt after prompt-callback.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#37639)
Problem: using NOT with a float returns a float in legacy vim script
(kennypete)
Solution: Return a number instead of a float (Yegappan Lakshmanan)
fixes: vim/vim#19282
closes: vim/vim#19289
https://github.com/vim/vim/commit/ecc3faef61cb02f28028f27184ccd2aadcee7c24
N/A patches:
vim-patch:8.2.1980: Vim9: some tests are not done at the script level
vim-patch:9.1.2122: Vim9: Negating a float doesn't result in a bool
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
|
| |
|
|
|
|
|
|
| |
Problem:
Currently, : mark is set in start of prompt-line. But more relevant
location is where the user text starts.
Solution:
Store and update column info on ': just like the line info
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: memory leak when not evaluating (just parsing) invalid literal
dict.
Solution: Always clear the key's typval (Sean Dewar)
Though "check_typval_is_value(&tv) == FAIL && !evaluate" is maybe never
true, also always clear tvs if check_typval_is_value fails; at worst
this would be a no-op as their initial types are VAR_UNKNOWN.
closes: vim/vim#19178
https://github.com/vim/vim/commit/b10a3e1a20c444ffea34be820e8ceba4b2503287
check_typval_is_value change is for Vim9 script. (from 9.0.2163)
N/A patch:
vim-patch:9.0.2163: Vim9: type can be assigned to list/dict
Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: ml_get error when resizing window and using text property.
Solution: Validate botline of the right window. (closes vim/vim#7528)
https://github.com/vim/vim/commit/23999d799cfe844b604f193183f8f84052c8e746
Migrate to Vim's (in)validate_botline_win() API.
Nvim wants to pass "curwin" instead of hiding them
behind alias/macro/inline-function.
https://github.com/neovim/neovim/pull/37164#discussion_r2655006908
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Background:
Suppose a window has concealed lines, and sets conceallevel>2,
concealcursor="". The concealed lines are displayed if the window is
curwin and the cursor is on the those lines.
Problem:
line('w$', win) switches curwin to win, and then does validate_botline
for curwin. It computes botline assuming the concealed lines displayed,
resulting in a smaller value than the actual botline that the user sees.
Solution:
Evaluate line('w$', win) without switching curwin.
Apply similar changes to other functions that switches curwin.
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Problem: Code for handling v: variables in generic eval file.
Solution: Move v: variables to evalvars.c. (Yegappan Lakshmanan,
closes vim/vim#4872)
https://github.com/vim/vim/commit/e5cdf153bcb348c68011b308c8988cea42d6ddeb
Cherry-pick get_vim_var_name() from 8.2.0149.
Cherry-pick evalvars.c changes from 8.2.1788.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
|
|
|
|
|
|
|
| |
Problem: Coverity warns for not checking allocation failure.
Solution: Check that allocating a list or blob succeeded.
https://github.com/vim/vim/commit/12553ada3b1ceee0179527abc9980b8392fd6c7e
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
|
|
|
|
|
|
| |
Problem: Code for handling file names is spread out.
Solution: Move code to new filepath.c file. Graduate FEAT_MODIFY_FNAME.
https://github.com/vim/vim/commit/b005cd80cfda591be95146024d9b97eef383500f
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
|
|
|
|
|
| |
Problem: nvim_parse_cmd('exe "ls"|edit foo', {}) fails to separate
nextcmd, returning args as { '"ls"|edit', 'foo' } instead of { '"ls"' }
with nextcmd='edit foo'.
Solution: Skip expressions before checking for '|' separator.
|
| |
|
|
|
|
|
|
|
| |
Problem: The eval.c file is too big.
Solution: Move filter() and map() to list.c.
https://github.com/vim/vim/commit/1e1d30048e722906a13665bd6c3c24c87eb2fe25
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: Vim9 script commands not sufficiently tested.
Solution: Add more tests. Fix storing global variable. Make script
variables work.
https://github.com/vim/vim/commit/b283a8a6802ef8a46b17cb439f9514840c03698f
Vim9 is N/A. Skip.
"set_vim_var_tv()" does not throw E1063 on type mismatch.
See https://github.com/neovim/neovim/pull/25394 .
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
|
|
|
|
|
|
|
|
| |
Problem: More code can be moved to evalvars.c.
Solution: Move code to where it fits better. (Yegappan Lakshmanan,
closes vim/vim#4883)
https://github.com/vim/vim/commit/da6c03342117fb7f4a8110bd9e8627b612a05a64
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
file (#35968)
Problem: Code for handling v: variables in generic eval file.
Solution: Move v: variables to evalvars.c. (Yegappan Lakshmanan,
closes vim/vim#4872)
https://github.com/vim/vim/commit/e5cdf153bcb348c68011b308c8988cea42d6ddeb
Remove direct reference to "vimvars" for following functions:
- assert_error()
- get_vim_var_nr()
- get_vim_var_list()
- get_vim_var_dict()
- get_vim_var_str()
- set_cmdarg()
- set_reg_var()
- set_vcount()
- set_vexception()
- set_vthrowpoint()
- set_vim_var_bool()
- set_vim_var_dict()
- set_vim_var_list()
- set_vim_var_nr()
- set_vim_var_special()
- set_vim_var_string()
- set_vim_var_type()
Reorder functions based on v8.2.4930 for
eval_one_expr_in_str() and eval_all_expr_in_str().
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
|
|
|
|
|
|
|
|
| |
Problem: The ops.c file is too big.
Solution: Move code for dealing with registers to a new file. (Yegappan
Lakshmanan, closes vim/vim#4982)
https://github.com/vim/vim/commit/4aea03eb875613e3eae2125b84f02b7cd898b2f8
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
|
|
|
|
|
|
|
|
|
| |
Problem: Some global functions can be local to the file.
Solution: Add "static". (Yegappan Lakshmanan, closes vim/vim#4917)
https://github.com/vim/vim/commit/840d16fd36bfd1a9fac8200e3dc016b1e3f9c328
Partial port because patch 8.2.0256 moves the timer functions to time.c.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Problem: some functions could be defined static
Solution: Change function definitions and make them static
(Yegappan Lakshmanan)
closes: vim/vim#18354
https://github.com/vim/vim/commit/3a6cf6d53b0ecf84ae4a0f8073996b34117251db
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: Crash when using nested map() and filter().
Solution: Do not set the v:key type to string without clearing the pointer.
https://github.com/vim/vim/commit/c36350bca3eed8ef97061e28c38b5b89cae1f13e
Port filter_map() changes from patch 8.1.1939.
Note: v8.1.1964 reverts a redundant change for `filter_map()` (now
within `filter_map_dict()`) from v8.1.1957.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
|
|
|
|
|
|
|
| |
Problem: Script tests fail.
Solution: Don't set vimvars type in set_vim_var_nr().
https://github.com/vim/vim/commit/34ed68d40eb9c71f34a44b94263f5e7e6856cba0
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
|
|
|
|
|
|
|
| |
Problem: Another outdated comment in eval.c (after 9.1.1665).
Solution: Remove that comment as well. Add a few more tests for mapnew()
that fail without patch 8.2.1672 (zeertzjq).
closes: vim/vim#18089
https://github.com/vim/vim/commit/6b5671180440f07f9f6955f46bab380bdc23f950
|
| |
|
|
|
|
|
|
|
| |
Problem: Outdated comment in eval.c.
Solution: Remove the comment, which is no longer true after 8.2.1672.
Also fix a typo in version9.txt (zeertzjq).
closes: vim/vim#18077
https://github.com/vim/vim/commit/5d3c39af2a54996dc365b5b38e3eaa6c971ae33a
|
| |
|
|
|
|
|
|
| |
Problem: v_lock is used when it is not initialized. (Yegappan Lakshmanan)
Solution: Initialize the typval in eval1().
https://github.com/vim/vim/commit/4a091b9978122428e7d9154d034c640c9c8d8c13
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
|
|
|
|
|
|
|
| |
These are not needed after #35129 but making uncrustify still play nice
with them was a bit tricky.
Unfortunately `uncrustify --update-config-with-doc` breaks strings
with backslashes. This issue has been reported upstream,
and in the meanwhile auto-update on every single run has been disabled.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
F{func}
Problem: completion: cannot use autoloaded funcs in 'complete' F{func}
(Maxim Kim)
Solution: Make it work (Girish Palya)
fixes: vim/vim#17869
closes: vim/vim#17885
https://github.com/vim/vim/commit/1bfe86a7d37ea849078255f16f99ed69fbf205dc
Cherry-pick Test_omni_autoload() from patch 8.2.3223.
Co-authored-by: Girish Palya <girishji@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: No numerical value for the patchlevel.
Solution: Add v:versionlong.
https://github.com/vim/vim/commit/37df9a4401f6737d6216306ea77a7e080c942aea
Restore "highest_patch()" solely for "v:versionlong".
Copy/paste Test_vvar_scriptversion2() from patch 9.1.1540.
It works without ":scriptversion 2".
In general, if Vim's test works with ":scriptversion 1", just port it
for additional coverage.
---
vim-patch:8.1.1565: MS-Windows: no sound support
Problem: MS-Windows: no sound support.
Solution: Add sound support for MS-Windows. (Yasuhiro Matsumoto, Ken Takata,
closes vim/vim#4522)
https://github.com/vim/vim/commit/9b283523f2f75b45feef902b8713808e883d9c19
----
"sound" feature is N/A now but this updates "v:versionlong" docs.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| | |
|