| Commit message (Collapse) | Author | Age |
... | |
| |
| |
| |
| |
| | |
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 }
|
| | |
|
|/ |
|
|
|
|
|
|
| |
.. instead of luaL_loadfile
allows files to be cached
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
| |
Adds a new vim.filetype module that provides support for filetype detection in
Lua.
|
| |
|
|
|
|
|
| |
Add support for adding and removing custom user commands with the Nvim
API.
|
|
|
|
|
|
| |
The Lua modules that make up vim.lua are embedded as raw source files into the
nvim binary. These sources are loaded by the Lua runtime on startuptime. We can
pre-compile these sources into Lua bytecode before embedding them into the
binary, which minimizes the size of the binary and improves startuptime.
|
|
|
|
|
| |
Possibly dialog code is messages.c could be moved here as well.
misc1.c is now empty, so delete it.
|
|
|
|
|
| |
Fixes `q` in more pager, where `:highlight` can be quit out of with a
single `q` keystroke, while in `:lua print(vim.inspect(vim))` it just
scrolls down a page.
|
|
|
| |
* refactor: reduce number of explicit char casts
|
| |
|
|
|
|
|
|
| |
Problem: Argument for message functions is inconsistent.
Solution: Make first argument to msg() "char *".
https://github.com/vim/vim/commit/32526b3c1846025f0e655f41efd4e5428da16b6c
|
|
|
|
|
|
|
|
|
| |
Problem: Giving error messages is not flexible.
Solution: Add semsg(). Change argument from "char_u *" to "char *", also
for msg() and get rid of most MSG macros. (Ozaki Kiichi, closes
vim/vim#3302) Also make emsg() accept a "char *" argument. Get rid of
an enormous number of type casts.
https://github.com/vim/vim/commit/f9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d
|
| |
|
|
|
|
|
| |
vim.str_utf_pos returns the codepoints for all utf-8 chars (only, currently)
in a string
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes #15147 and fixes #15497. Also sketch "subdir" caching. Currently
this only caches whether an rtp entry has a "lua/" subdir but we could
consider cache other subdirs potentially or even "lua/mybigplugin/"
possibly.
Note: the async_leftpad test doesn't actually fail on master, at least
not deterministically (even when disabling the fast_breakcheck
throttling). It's still useful as a regression test for further changes
and included as such.
|
|
|
|
| |
* refactor: format with uncrustify
* refactor: convert function comments to doxygen
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* add vim.json.encode and vim.json.decode
* use vim.NIL instead of cjson.null
* resolve strict-prototypes warnings
* The following benchmark shows an approximately 2.5x (750 ms vs 300 ms) improvement in deserialization performance over
vim.fn.json_decode on a medium package.json
```lua
local uv = vim.loop
local function readfile(path)
return
end
local json_url = "https://raw.githubusercontent.com/rust-analyzer/rust-analyzer/b24c8d5c89ee93d1172b4127564f5da3b0c88dad/editors/code/package.json"
io.popen(string.format('curl -v -f -L -O %q &> /dev/null', json_url))
local json_string = io.open('package.json'):read '*a'
uv.update_time()
local start = uv.hrtime()
for i = 1,1000 do
vim.fn.json_decode(json_string)
end
uv.update_time()
print(string.format("Deserialization time vim.fn.json_decode: %s ms", (uv.hrtime() - start) * (1e-6)))
uv.update_time()
local start = uv.hrtime()
for i = 1,1000 do
vim.json.decode(json_string)
end
uv.update_time()
print(string.format("Deserialization time vim.json.decode: %s ms", (uv.hrtime() - start) * (1e-6)))
```
Co-Authored-By: Björn Linse <bjorn.linse@gmail.com>
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Analogous to nodejs's `on('data', …)` interface, here on_key is the "add
listener" interface.
ref 3ccdbc570d85 #12536
BREAKING_CHANGE: vim.register_keystroke_callback() is now an error.
|
|
|
|
|
|
|
|
|
|
| |
fixes #15524
Note: this is obviously a quickfix. A scalabe solution will
involve being able to specify a _list_ of modules to be
put into packages.preload, without needing to manually copypasta
a blurb of C code. Perhaps even involving bytecode for
static builds (to speedup initialization)
|
|\
| |
| | |
Port VimL's method call syntax - vim-patch:8.1.{1638,1800,1803,1807,1809,1816,1820,1821,1828,1834,1835,1861,1863,1878,1879,1888,1909,1911,1912}
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Function call functions have too many arguments.
Solution: Pass values in a funcexe_T struct.
https://github.com/vim/vim/commit/c6538bcc1cdd1fb83732f22fdc69bd9bb66f968a
Use FUNCEXE_INIT to initialize funcexe_T instances.
call_callback() and other Vim listener related stuff is N/A.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Note: the reason for removing them is not that there after this refactor
is no use of them, but rather that having them available is an
anti-pattern: they manange an _extra_ heap allocation which has
nothing to do with the functionality of the map itself (khash
manages the real buffers internally). In case there happens to
be a reason to allocate the map structure itself later, this
should be made explicit using xcalloc/xfree calls.
|
|\ \
| | |
| | | |
perf(map): get rid of unnecessary pointer indirections for maps.
|
| |/
| |
| |
| |
| | |
These things are just maps to pointers, no need to perform
a huge song and dance around it.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* feat(api): add lua C bindings for xdiff
* chore: opt.hunk_lines -> opt.result_type
opt.on_hunk now takes precedence over opt.result_type
* chore: fix indents
Fix indents
* chore: change how priv is managed
Assign priv NULL and unconditionally apply XFREE_CLEAR to it when
finished.
|
|
|
|
|
|
|
|
|
|
| |
lua is used as part of implementation for more core features. As an
example, every user keypress will invoke a lua function to check for
keypress handlers (regardless if they are registered or not). Thus not
starting lua until it is first used doesn't make much sense anymore.
nlua_enter was also needed due to the earlier stateful &rtp
translation, which by now have been made stateless.
|
| |
|
|
|
|
|
|
|
| |
When a keymap is set from lua currently verbose message says
it's set from line 1. That's incorrect because we don't really know when
it was set. So until proper :verbose support isn't added for sourceing
lua it shouldn't say where it was set at.
|
|
|
|
|
|
| |
So now :source can run lua files too :)
* feat: Add support for :[ranged]source for lua files
|
| |
|
|\
| |
| | |
extmark: splice extmarks on :luado
|
| | |
|
| | |
|
| |
| |
| |
| | |
I AM THE TABLE
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
retrun a structured version dict
:lua print(vim.inspect(vim.version()))
{
api_compatible = 0,
api_level = 7,
api_prerelease = true,
major = 0,
minor = 5,
patch = 0
}
|