| Commit message (Collapse) | Author | Age |
... | |
|
|
|
|
|
| |
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
}
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
¡NO HAY BANDA!
|
|
|
|
|
|
|
|
|
|
| |
co-author: hlpr98 <hlpr98@gmail.com> (dict2hlattrs function)
orange is sus??
NOVEMBER DAWN
erase the lie that is redraw_later()
|
|
|
|
|
|
|
|
|
| |
* lua: vim.wait allows control of fast events
* fixup: remove requirement of function for easier waiting
* fixup: lint
* fixup: bfredl comments
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* feat: Add vim.register_keystroke_callback
* fixup: Forgot to remove mention of old option
* fixup: Answer jamessan comments
* fixup: Answer norcalli comments
* fixup: portability
* Update runtime/doc/lua.txt
Co-authored-by: Ashkan Kiani <ashkan.k.kiani@gmail.com>
|
| |
|
|\
| |
| | |
build: Fix build failure with CI in FreeBSD
|
| |
| |
| |
| | |
Co-authored-by: James McCoy <jamessan@jamessan.com>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Can be reproduced with a script like this:
-- in some lua file
vim.fn.timer_start(10, function() error("uh....") end)
-- will cause neovim to crash with the following error.
PANIC: unprotected error in call to Lua API
(nlua_CFunction_func_call failed.)
After this, it will instead print the error message
from the top of the stack, like so.
tmp/error_nvim.lua:10: uh...
Also added an example test. Previously this test
caused the embedded nvim to panic.
|
|
|
|
|
|
|
|
|
|
|
|
| |
vim-patch:8.2.1054: not so easy to pass a lua function to Vim
vim-patch:8.2.1084: Lua: registering function has useless code
I think I have also opened up the possibility for people to use these
callbacks elsewhere, since I've added a new struct that we should be
able to use.
Also, this should allow us to determine what the state of a list is in
Lua or a dictionary in Lua, since we now can track the luaref as we go.
|
| |
|