<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rneovim.git/src/nvim/lua, branch mix_20240309</title>
<subtitle>Neovim fork with Rahm's personal hacks.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/'/>
<entry>
<title>refactor(msgpack): allow flushing buffer while packing msgpack</title>
<updated>2024-03-07T08:39:46+00:00</updated>
<author>
<name>bfredl</name>
<email>bjorn.linse@gmail.com</email>
</author>
<published>2024-02-25T14:02:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=dc37c1550bed46fffbb677d343cdc5bc94056219'/>
<id>dc37c1550bed46fffbb677d343cdc5bc94056219</id>
<content type='text'>
Before, we needed to always pack an entire msgpack_rpc Object to
a continous memory buffer before sending it out to a channel.
But this is generally wasteful. it is better to just flush
whatever is in the buffer and then continue packing to a new buffer.

This is also done for the UI event packer where there are some extra logic
to "finish" of an existing batch of nevents/ncalls. This doesn't really
stop us from flushing the buffer, just that we need to update the state
machine accordingly so the next call to prepare_call() always will
start with a new event (even though the buffer might contain overflow
data from a large event).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before, we needed to always pack an entire msgpack_rpc Object to
a continous memory buffer before sending it out to a channel.
But this is generally wasteful. it is better to just flush
whatever is in the buffer and then continue packing to a new buffer.

This is also done for the UI event packer where there are some extra logic
to "finish" of an existing batch of nevents/ncalls. This doesn't really
stop us from flushing the buffer, just that we need to update the state
machine accordingly so the next call to prepare_call() always will
start with a new event (even though the buffer might contain overflow
data from a large event).
</pre>
</div>
</content>
</entry>
<entry>
<title>refactor(metadata): generate all metadata in lua</title>
<updated>2024-02-28T10:00:38+00:00</updated>
<author>
<name>bfredl</name>
<email>bjorn.linse@gmail.com</email>
</author>
<published>2024-02-26T17:00:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=de5cf09cf98e20d8d3296ad6933ff2741acf83f7'/>
<id>de5cf09cf98e20d8d3296ad6933ff2741acf83f7</id>
<content type='text'>
Then we can just load metadata in C as a single msgpack blob. Which also
can be used directly as binarly data, instead of first unpacking all the
functions and ui_events metadata to immediately pack it again, which was
a bit of a silly walk (and one extra usecase of `msgpack_rpc_from_object`
which will get yak shaved in the next PR)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Then we can just load metadata in C as a single msgpack blob. Which also
can be used directly as binarly data, instead of first unpacking all the
functions and ui_events metadata to immediately pack it again, which was
a bit of a silly walk (and one extra usecase of `msgpack_rpc_from_object`
which will get yak shaved in the next PR)
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge pull request #27599 from bfredl/nofilealloc</title>
<updated>2024-02-26T13:43:42+00:00</updated>
<author>
<name>bfredl</name>
<email>bjorn.linse@gmail.com</email>
</author>
<published>2024-02-26T13:43:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=7038fdeee2561ef29bd41e3f5ac54823c76d8143'/>
<id>7038fdeee2561ef29bd41e3f5ac54823c76d8143</id>
<content type='text'>
refactor(fileio): remove API shell layer encouraging unnecessary allocations</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
refactor(fileio): remove API shell layer encouraging unnecessary allocations</pre>
</div>
</content>
</entry>
<entry>
<title>fix(mbyte): fix bugs in utf_cp_*_off() functions</title>
<updated>2024-02-26T10:12:55+00:00</updated>
<author>
<name>VanaIgr</name>
<email>vanaigranov@gmail.com</email>
</author>
<published>2024-02-26T10:12:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=ad5a155b1f4b387d3aaa54c91d0146cb0287bb9f'/>
<id>ad5a155b1f4b387d3aaa54c91d0146cb0287bb9f</id>
<content type='text'>
Problems:
- Illegal bytes after valid UTF-8 char cause utf_cp_*_off() to fail.
- When stream isn't NUL-terminated, utf_cp_*_off() may go over the end.
Solution: Don't go over end of the char of end of the string.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problems:
- Illegal bytes after valid UTF-8 char cause utf_cp_*_off() to fail.
- When stream isn't NUL-terminated, utf_cp_*_off() may go over the end.
Solution: Don't go over end of the char of end of the string.</pre>
</div>
</content>
</entry>
<entry>
<title>refactor(fileio): remove API shell layer encouraging unnecessary allocations</title>
<updated>2024-02-25T10:20:06+00:00</updated>
<author>
<name>bfredl</name>
<email>bjorn.linse@gmail.com</email>
</author>
<published>2024-02-24T09:17:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=77e928fd3e92f35182237b663437d7ebde7ebde7'/>
<id>77e928fd3e92f35182237b663437d7ebde7ebde7</id>
<content type='text'>
Functions like file_open_new() and file_open_fd_new() which just is a
wrapper around the real functions but with an extra xmalloc/xfree around
is an anti-pattern. If the caller really needs to allocate a
FileDescriptor as a heap object, it can do that directly.

FileDescriptor by itself is pretty much a pointer, or rather two:
the OS fd index and a pointer to a buffer. So most of the time an extra
pointer layer is just wasteful.

In the case of scriptin[curscript] in getchar.c, curscript used
to mean in practice:

N+1 open scripts           when curscript&gt;0
zero or one open scripts   when curscript==0

Which means scriptin[0] had to be compared to NULL to disambiguate the
curscript=0 case.

Instead, use curscript==-1 to mean that are no script,
then all pointer comparisons dissappear and we can just use an array of
structs without extra pointers.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Functions like file_open_new() and file_open_fd_new() which just is a
wrapper around the real functions but with an extra xmalloc/xfree around
is an anti-pattern. If the caller really needs to allocate a
FileDescriptor as a heap object, it can do that directly.

FileDescriptor by itself is pretty much a pointer, or rather two:
the OS fd index and a pointer to a buffer. So most of the time an extra
pointer layer is just wasteful.

In the case of scriptin[curscript] in getchar.c, curscript used
to mean in practice:

N+1 open scripts           when curscript&gt;0
zero or one open scripts   when curscript==0

Which means scriptin[0] had to be compared to NULL to disambiguate the
curscript=0 case.

Instead, use curscript==-1 to mean that are no script,
then all pointer comparisons dissappear and we can just use an array of
structs without extra pointers.
</pre>
</div>
</content>
</entry>
<entry>
<title>refactor(api): use an arena for mappings</title>
<updated>2024-02-18T09:15:27+00:00</updated>
<author>
<name>bfredl</name>
<email>bjorn.linse@gmail.com</email>
</author>
<published>2024-02-17T19:31:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=f25fcc68a34c2d51b0715fadc62cb50509de338b'/>
<id>f25fcc68a34c2d51b0715fadc62cb50509de338b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(treesitter): correctly handle query quantifiers (#24738)</title>
<updated>2024-02-16T17:54:47+00:00</updated>
<author>
<name>Thomas Vigouroux</name>
<email>thomas.vigouroux@protonmail.com</email>
</author>
<published>2024-02-16T17:54:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=bd5008de07d29a6457ddc7fe13f9f85c9c4619d2'/>
<id>bd5008de07d29a6457ddc7fe13f9f85c9c4619d2</id>
<content type='text'>
Query patterns can contain quantifiers (e.g. (foo)+ @bar), so a single
capture can map to multiple nodes. The iter_matches API can not handle
this situation because the match table incorrectly maps capture indices
to a single node instead of to an array of nodes.

The match table should be updated to map capture indices to an array of
nodes. However, this is a massively breaking change, so must be done
with a proper deprecation period.

`iter_matches`, `add_predicate` and `add_directive` must opt-in to the
correct behavior for backward compatibility. This is done with a new
"all" option. This option will become the default and removed after the
0.10 release.

Co-authored-by: Christian Clason &lt;c.clason@uni-graz.at&gt;
Co-authored-by: MDeiml &lt;matthias@deiml.net&gt;
Co-authored-by: Gregory Anders &lt;greg@gpanders.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Query patterns can contain quantifiers (e.g. (foo)+ @bar), so a single
capture can map to multiple nodes. The iter_matches API can not handle
this situation because the match table incorrectly maps capture indices
to a single node instead of to an array of nodes.

The match table should be updated to map capture indices to an array of
nodes. However, this is a massively breaking change, so must be done
with a proper deprecation period.

`iter_matches`, `add_predicate` and `add_directive` must opt-in to the
correct behavior for backward compatibility. This is done with a new
"all" option. This option will become the default and removed after the
0.10 release.

Co-authored-by: Christian Clason &lt;c.clason@uni-graz.at&gt;
Co-authored-by: MDeiml &lt;matthias@deiml.net&gt;
Co-authored-by: Gregory Anders &lt;greg@gpanders.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>refactor(eval): use arena when converting typvals to Object</title>
<updated>2024-02-15T09:42:06+00:00</updated>
<author>
<name>bfredl</name>
<email>bjorn.linse@gmail.com</email>
</author>
<published>2024-02-12T19:40:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=d60412b18e4e21f301baa2ac3f3fb7be89655e4b'/>
<id>d60412b18e4e21f301baa2ac3f3fb7be89655e4b</id>
<content type='text'>
Note: this contains two _temporary_ changes which can be reverted
once the Arena vs no-Arena distinction in API wrappers has been removed.
Both nlua_push_Object and object_to_vim_take_luaref() has been changed
to take the object argument as a pointer. This is not going to be
necessary once these are only used with arena (or not at all) allocated
Objects.

The object_to_vim() variant which leaves luaref untouched might need to
stay for a little longer.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Note: this contains two _temporary_ changes which can be reverted
once the Arena vs no-Arena distinction in API wrappers has been removed.
Both nlua_push_Object and object_to_vim_take_luaref() has been changed
to take the object argument as a pointer. This is not going to be
necessary once these are only used with arena (or not at all) allocated
Objects.

The object_to_vim() variant which leaves luaref untouched might need to
stay for a little longer.
</pre>
</div>
</content>
</entry>
<entry>
<title>refactor(lua): use a keyset for vim.diff opts parsing</title>
<updated>2024-02-13T10:54:44+00:00</updated>
<author>
<name>bfredl</name>
<email>bjorn.linse@gmail.com</email>
</author>
<published>2024-02-11T18:13:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=1a3a8d903e9705ce41867e1cbc629a85c7cb6252'/>
<id>1a3a8d903e9705ce41867e1cbc629a85c7cb6252</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>refactor(lua): use Arena when converting from lua stack to API args</title>
<updated>2024-02-13T10:54:44+00:00</updated>
<author>
<name>bfredl</name>
<email>bjorn.linse@gmail.com</email>
</author>
<published>2024-02-11T14:46:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=0353dd3029f9ce31c3894530385443a90f6677ee'/>
<id>0353dd3029f9ce31c3894530385443a90f6677ee</id>
<content type='text'>
and for return value of nlua_exec/nlua_call_ref, as this uses
the same family of functions.

NB: the handling of luaref:s is a bit of a mess.
add api_luarefs_free_XX functions as a stop-gap as refactoring
luarefs is a can of worms for another PR:s.

as a minor feature/bug-fix, nvim_buf_call and nvim_win_call now preserves
arbitrary return values.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
and for return value of nlua_exec/nlua_call_ref, as this uses
the same family of functions.

NB: the handling of luaref:s is a bit of a mess.
add api_luarefs_free_XX functions as a stop-gap as refactoring
luarefs is a can of worms for another PR:s.

as a minor feature/bug-fix, nvim_buf_call and nvim_win_call now preserves
arbitrary return values.
</pre>
</div>
</content>
</entry>
</feed>
