| Commit message (Collapse) | Author | Age |
... | |
|\ \
| | |
| | | |
feat(lua): add :verbose support for lua config
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
`:verbose` didn't work properly with lua configs (For example:
options or keymaps are set from lua, just say that they were set
from lua, doesn't say where they were set at.
This fixes that issue. Now `:verbose` will provide filename and line no
when option/keymap is set from lua.
Changes:
- compiles lua/vim/keymap.lua as vim/keymap.lua
- When souring a lua file current_sctx.sc_sid is set to SID_LUA
- Moved finding scripts SID out of `do_source()` to `get_current_script_id()`.
So it can be reused for lua files.
- Added new function `nlua_get_sctx` that extracts current lua scripts
name and line no with debug library. And creates a sctx for it.
NOTE: This function ignores C functions and blacklist which
currently contains only vim/_meta.lua so vim.o/opt wrappers aren't
targeted.
- Added function `nlua_set_sctx` that changes provided sctx to current
lua scripts sctx if a lua file is being executed.
- Added tests in tests/functional/lua/verbose_spec.lua
- add primary support for additional types (:autocmd, :function, :syntax) to lua verbose
Note: These can't yet be directly set from lua but once that's possible
:verbose should work for them hopefully :D
- add :verbose support for nvim_exec & nvim_command within lua
Currently auto commands/commands/functions ... can only be defined
by nvim_exec/nvim_command this adds support for them. Means if those
Are defined within lua with vim.cmd/nvim_exec :verbose will show their
location . Though note it'll show the line no on which nvim_exec call was made.
|
| | | |
|
| | |
| | |
| | |
| | | |
Note: some of these changes are breaking, like change of API signatures
|
|\ \ \
| |/ /
|/| | |
fix(api): convert blob to NUL-terminated API string
|
| | |
| | |
| | |
| | |
| | | |
Looks like I did an oopsie; although API strings carry a size field, they should
still be usable as C-strings! (even though they may contain embedded NULs)
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
Works similar to ex <f-args>. It only splits the arguments if the
command has more than one posible argument. In cases were the command
can only have 1 argument opts.fargs = { opts.args }
|
|\ \ \
| | | |
| | | | |
support threads in lua
|
| |/ / |
|
|\ \ \
| |/ /
|/| | |
fix(api): nvim_win_set_cursor() redraw for cursorline and statusline
|
| |/ |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
nvim_buf_set_text does not handle negative row numbers correctly: for
example,
nvim_buf_set_text(0, -2, 0, -1, 20, {"Hello", "world"})
should replace the 2nd to last line in the buffer with "Hello" and the
first 20 characters of the last line with "world". Instead, it reports
"start_row out of bounds". This happens because when negative line
numbers are used, they are incremented by one additional number to make
the non-negative line numbers end-exclusive. However, the line numbers
for nvim_buf_set_text should be end-inclusive.
In #15181 we handled this for nvim_buf_get_text by adding a new
parameter to `normalize_index`. We can solve the problem with
nvim_buf_set_text by simply availing ourselves of this new argument.
This is a breaking change, but makes the semantics of negative line
numbers much clearer and more obvious (as well as matching
nvim_buf_get_text).
BREAKING CHANGE: Existing usages of nvim_buf_set_text that use negative
line numbers will be off-by-one.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
nvim_buf_get_text is the mirror of nvim_buf_set_text. It differs from
nvim_buf_get_lines in that it allows retrieving only portions of lines.
While this can typically be done easily enough by API clients,
implementing this function provides symmetry between the get/set
text/lines APIs, and also provides a nice convenience that saves API
clients the work of having to slice the result of nvim_buf_get_lines
themselves.
|
| |
| |
| |
| |
| |
| |
| |
| | |
... for when `ns=0`.
Also update the documentation of nvim_set_hl to clarify the set
behaviour.
Fixes #17478
|
|\ \
| | |
| | | |
fix(api): re-route nvim_get_runtime_file errors
|
| | |
| | |
| | |
| | | |
This allows nvim_get_runtime_file to be properly used via pcall
|
|/ / |
|
|/
|
|
| |
This uses the same validation used when defining commands with
`:command`.
|
| |
|
| |
|
|\
| |
| | |
fix: close floating windows when calling win_close()
|
| | |
|
|/
|
|
| |
Co-Authored-By: smolck <46855713+smolck@users.noreply.github.com>
|
|\
| |
| | |
refactor(api): use a keyset for highlight dicts
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We have to be sure that the bugs fixed in the previous patches also apply to
nvim_win_call.
Checking v8.1.2124 and v8.2.4026 is especially important as these patches were
only applied to win_execute, but nvim_win_call is also affected by the same
bugs. A lot of win_execute's logic can be shared with nvim_win_call, so factor
it out into a common macro to reduce the possibility of this happening again.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: ml_get error when win_execute redraws with Visual selection.
Solution: Disable Visual area temporarily. (closes vim/vim#9479)
https://github.com/vim/vim/commit/18f4740f043b353abe47b7a00131317052457686
{switch_to/restore}_win_for_buf is N/A (marked as such in v8.0.0860; currently
only used in Vim's if_py).
Add a modeline to test_execute_func.vim.
|
|\ \
| |/
|/| |
vim-patch:8.2.4241: some type casts are redundant
|
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Some type casts are redundant.
Solution: Remove the type casts. (closes vim/vim#9643)
https://github.com/vim/vim/commit/420fabcd4ffeaf79082a6e43db91e1d363f88f27
This is not a literal port but an equivalent one.
|
|\ \
| | |
| | | |
feat(highlight): ns=0 to set :highlight namespace
|
| |/
| |
| |
| | |
Passing ns=0 to nvim_set_hl will alter the `:highlight` namespace.
|
|\ \
| |/
|/| |
feat(statusline): support multibyte fillchar
|
| |
| |
| |
| |
| |
| |
| |
| | |
This includes a partial port of Vim patch 8.2.2569 and some changes to
nvim_eval_statusline() to allow a multibyte fillchar. Literally every
line of C code touched by that patch has been refactored in Nvim, and
that patch contains some irrelevant foldcolumn tests I'm not sure how to
port (as Nvim's foldcolumn behavior has diverged from Vim's).
|
|\ \
| | |
| | | |
feat(api): expose extmark right_gravity and end_right_gravity
|
| | | |
|
|\ \ \
| |/ /
|/| | |
Various Coverity fixes
|
| | | |
|
| |/
| |
| |
| | |
Since we already have a typval, we know the lookup will succeed.
|
|\ \
| | |
| | | |
vim-patch:8.2.{3584,3586,3587}: :command "-keepscript" argument
|
| |/
| |
| |
| |
| |
| |
| |
| | |
Problem: "verbose set efm" reports the location of the :compiler command.
(Gary Johnson)
Solution: Add the "-keepscript" argument to :command and use it when
defining CompilerSet.
https://github.com/vim/vim/commit/58ef8a31d7087d495ab1582be5b7a22796ac2451
|
|\ \
| | |
| | | |
input: never escape CSI bytes and clean up related names and comments
|
| |/ |
|
|/ |
|
|\
| |
| | |
refactor(marks): use a more efficient representation with less pointer indirection
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
marktree.c was originally constructed as a "generic" datatype,
to make the prototyping of its internal logic as simple as possible
and also as the usecases for various kinds of extmarks/decorations was not yet decided.
As a consequence of this, various extra indirections and allocations was
needed to use marktree to implement extmarks (ns/id pairs) and
decorations of different kinds (some which is just a single highlight
id, other an allocated list of virtual text/lines)
This change removes a lot of indirection, by making Marktree specialized
for the usecase. In particular, the namespace id and mark id is stored
directly, instead of the 64-bit global id particular to the Marktree
struct. This removes the two maps needed to convert between global and
per-ns ids.
Also, "small" decorations are stored inline, i.e. those who
doesn't refer to external heap memory anyway. That is highlights (with
priority+flags) are stored inline, while virtual text, which anyway
occurs a lot of heap allocations, do not. (previously a hack was used
to elide heap allocations for highlights with standard prio+flags)
TODO(bfredl): the functionaltest-lua CI version of gcc is having
severe issues with uint16_t bitfields, so splitting up compound
assignments and redundant casts are needed. Clean this up once we switch
to a working compiler version.
|
|\ \
| |/
|/| |
feat(extmarks): add strict option
|
| | |
|
| | |
|