<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rneovim.git/src/nvim/eval, branch userregs_2</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>fix(repeat_cmdline): Save the repeat_cmdline when calling a userfunc.</title>
<updated>2025-04-16T17:41:19+00:00</updated>
<author>
<name>Josh Rahm</name>
<email>joshuarahm@gmail.com</email>
</author>
<published>2025-04-10T05:10:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=d9f4bc7bbd305c0a0a57ee78f99f8349ff97964e'/>
<id>d9f4bc7bbd305c0a0a57ee78f99f8349ff97964e</id>
<content type='text'>
There's a very subtle bug when calling a userfunc where the redo buffer
is saved, but the repeat_cmdline is not. This causes the redo buffer on
do-repeat to call the most recently executed userfunc rather than the
userfunc it should be dot-repeating.

This is only an issue when trying to dot-repeat a userfunction within a
user function.

I found this bug when experimenting with using text motions,
specifically the Z* verbs in fieldmarshal. Specifically the Z* motions
(for inserting/appending before/after a text object) would be
dot-repeatable for builtin text objects, but would not be dot-repeatable
for user-defined text objects.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There's a very subtle bug when calling a userfunc where the redo buffer
is saved, but the repeat_cmdline is not. This causes the redo buffer on
do-repeat to call the most recently executed userfunc rather than the
userfunc it should be dot-repeating.

This is only an issue when trying to dot-repeat a userfunction within a
user function.

I found this bug when experimenting with using text motions,
specifically the Z* verbs in fieldmarshal. Specifically the Z* motions
(for inserting/appending before/after a text object) would be
dot-repeatable for builtin text objects, but would not be dot-repeatable
for user-defined text objects.
</pre>
</div>
</content>
</entry>
<entry>
<title>feat(userregfunc): programmable user-defined registers with multibyte support</title>
<updated>2025-04-16T17:41:19+00:00</updated>
<author>
<name>Josh Rahm</name>
<email>joshuarahm@gmail.com</email>
</author>
<published>2025-04-09T23:46:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=2034a8419e1c5675592cdd0d0ffeaadfda58001a'/>
<id>2034a8419e1c5675592cdd0d0ffeaadfda58001a</id>
<content type='text'>
This patch introduces a new global option `userregfunc`, allowing users
to define custom behavior for registers not handled by Neovim
internally. This enables programmable registers using any Unicode
character — including multibyte characters.

- A new register slot `USER_REGISTER` is introduced. Any register not
  matching the standard set (`0-9a-zA-Z"+-*%#/:.=`, etc.) is routed
  through this system.

- When such a register is accessed, the function defined in
  `userregfunc` is called with three arguments:

    1. `{action}` (string): either `"yank"` or `"put"`
    2. `{register}` (string): UTF-8 character name of the register
    3. `{content}`:
       - If `action == "yank"`: a dictionary with these keys:
         - `lines` (list of strings): the yanked text
         - `type` (string): one of `"v"` (charwise), `"V"` (linewise), or `"b"` (blockwise)
         - `width` (number, optional): present if `type == "b"`
         - `additional_data` (dict, optional): user-extensible metadata
       - If `action == "put"`: this is always `v:null`

- The function may return either:
    - A **string** (used as a charwise register), or
    - A **dictionary** matching the structure above

- Internally, `read_userregister()` and `write_userregister()` convert
  between `yankreg_T` and typval dictionaries.

- Messages and internal logic fully support multibyte register names via
  UTF-8.

- A new `USER_REGISTER` slot is used for logical separation in the
  register table.

Included in this patch is an extensible Lua framework (`vim.userregs`)
for defining user register handlers in Lua. It provides per-register
handlers via `register_handler(registers, handler)`

The global function `_G.def_userreg_func` is registered as the default
implementation of `'userregfunc'`, enabling seamless integration with
the Lua framework.

- Register `λ` dynamically inserts the current date
- Register `&amp;` reads and writes from a "global register" file under
  `stdpath("run")`
- Register `?` returns the result of a shell command
- Registers that auto-adjust based on filetype, cursor context, or
  Treesitter nodes

This change expands the register model into a programmable abstraction —
fully scriptable and extensible — without breaking compatibility.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch introduces a new global option `userregfunc`, allowing users
to define custom behavior for registers not handled by Neovim
internally. This enables programmable registers using any Unicode
character — including multibyte characters.

- A new register slot `USER_REGISTER` is introduced. Any register not
  matching the standard set (`0-9a-zA-Z"+-*%#/:.=`, etc.) is routed
  through this system.

- When such a register is accessed, the function defined in
  `userregfunc` is called with three arguments:

    1. `{action}` (string): either `"yank"` or `"put"`
    2. `{register}` (string): UTF-8 character name of the register
    3. `{content}`:
       - If `action == "yank"`: a dictionary with these keys:
         - `lines` (list of strings): the yanked text
         - `type` (string): one of `"v"` (charwise), `"V"` (linewise), or `"b"` (blockwise)
         - `width` (number, optional): present if `type == "b"`
         - `additional_data` (dict, optional): user-extensible metadata
       - If `action == "put"`: this is always `v:null`

- The function may return either:
    - A **string** (used as a charwise register), or
    - A **dictionary** matching the structure above

- Internally, `read_userregister()` and `write_userregister()` convert
  between `yankreg_T` and typval dictionaries.

- Messages and internal logic fully support multibyte register names via
  UTF-8.

- A new `USER_REGISTER` slot is used for logical separation in the
  register table.

Included in this patch is an extensible Lua framework (`vim.userregs`)
for defining user register handlers in Lua. It provides per-register
handlers via `register_handler(registers, handler)`

The global function `_G.def_userreg_func` is registered as the default
implementation of `'userregfunc'`, enabling seamless integration with
the Lua framework.

- Register `λ` dynamically inserts the current date
- Register `&amp;` reads and writes from a "global register" file under
  `stdpath("run")`
- Register `?` returns the result of a shell command
- Registers that auto-adjust based on filetype, cursor context, or
  Treesitter nodes

This change expands the register model into a programmable abstraction —
fully scriptable and extensible — without breaking compatibility.
</pre>
</div>
</content>
</entry>
<entry>
<title>refactor(eval): move diff functions to diff.c (#33085)</title>
<updated>2025-03-27T13:35:20+00:00</updated>
<author>
<name>zeertzjq</name>
<email>zeertzjq@outlook.com</email>
</author>
<published>2025-03-27T13:35:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=d01d4764804bd73ce213aab76a394c62c9f7d193'/>
<id>d01d4764804bd73ce213aab76a394c62c9f7d193</id>
<content type='text'>
They were moved in Vim in patch 8.1.1989.
This change is required to port patch 9.1.1243.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
They were moved in Vim in patch 8.1.1989.
This change is required to port patch 9.1.1243.</pre>
</div>
</content>
</entry>
<entry>
<title>fix(messages): incorrect error message splitting and kind #32990</title>
<updated>2025-03-19T18:04:08+00:00</updated>
<author>
<name>luukvbaal</name>
<email>luukvbaal@gmail.com</email>
</author>
<published>2025-03-19T18:04:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=51853b82bc95a7b62875d07a0ade6cfa0bdd0b5b'/>
<id>51853b82bc95a7b62875d07a0ade6cfa0bdd0b5b</id>
<content type='text'>
Problem:  Message kind logic for emitting an error message is convoluted
          and still results in emitting an unfinished message earlier than
          wanted.
Solution: Ensure emsg_multiline() always sets the kind wanted by the caller
          and doesn't isn't unset to logic for emitting the source message.
          Caller is responsible for making sure multiple message chunks are
          not emitted as multiple events by setting `msg_ext_skip_flush`...</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:  Message kind logic for emitting an error message is convoluted
          and still results in emitting an unfinished message earlier than
          wanted.
Solution: Ensure emsg_multiline() always sets the kind wanted by the caller
          and doesn't isn't unset to logic for emitting the source message.
          Caller is responsible for making sure multiple message chunks are
          not emitted as multiple events by setting `msg_ext_skip_flush`...</pre>
</div>
</content>
</entry>
<entry>
<title>docs: misc #32959</title>
<updated>2025-03-18T13:18:37+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2025-03-18T13:18:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=7333c39e6cc78786289d88c65fbe10e4ce78992b'/>
<id>7333c39e6cc78786289d88c65fbe10e4ce78992b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(messages): no trailing newline for inputlist, tselect, z= with ext_messages</title>
<updated>2025-03-13T10:33:35+00:00</updated>
<author>
<name>Luuk van Baal</name>
<email>luukvbaal@gmail.com</email>
</author>
<published>2025-03-13T01:14:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=282f73f067cb935612782d55efa99036505d363f'/>
<id>282f73f067cb935612782d55efa99036505d363f</id>
<content type='text'>
Problem:  Various list commands end in a newline to go to a new line on
          the message grid for the prompt message, which is unwanted
          with ext_messages.
Solution: Don't emit a trailing newline with ext_messages for
          inputlist(), :tselect and z=.

Co-authored-by: Tomasz N &lt;przepompownia@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:  Various list commands end in a newline to go to a new line on
          the message grid for the prompt message, which is unwanted
          with ext_messages.
Solution: Don't emit a trailing newline with ext_messages for
          inputlist(), :tselect and z=.

Co-authored-by: Tomasz N &lt;przepompownia@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vim-patch:9.1.1195: inside try-block: fn body executed with default arg undefined (#32866)</title>
<updated>2025-03-13T00:46:47+00:00</updated>
<author>
<name>zeertzjq</name>
<email>zeertzjq@outlook.com</email>
</author>
<published>2025-03-13T00:46:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=90d1260cb84c917653987c0dfdfa150b617f5a0f'/>
<id>90d1260cb84c917653987c0dfdfa150b617f5a0f</id>
<content type='text'>
Problem:  inside try-block: fn body executed when default arg is
          undefined
Solution: When inside a try-block do not execute function body after an
          error in evaluating a default argument expression
          (Shane Harper).

closes: vim/vim#16865

https://github.com/vim/vim/commit/2d18789aa67cc60072ea0cf21811c403fa0b2c7b

Co-authored-by: Shane Harper &lt;shane@shaneharper.net&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:  inside try-block: fn body executed when default arg is
          undefined
Solution: When inside a try-block do not execute function body after an
          error in evaluating a default argument expression
          (Shane Harper).

closes: vim/vim#16865

https://github.com/vim/vim/commit/2d18789aa67cc60072ea0cf21811c403fa0b2c7b

Co-authored-by: Shane Harper &lt;shane@shaneharper.net&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>refactor(multiqueue): rename multiqueue_new_parent #32767</title>
<updated>2025-03-08T20:28:15+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2025-03-08T20:28:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=05b9daa1e6e8d045f691b74441ebbc01f69a56aa'/>
<id>05b9daa1e6e8d045f691b74441ebbc01f69a56aa</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>vim-patch:9.1.1169: using global variable for get_insert()/get_lambda_name() (#32713)</title>
<updated>2025-03-03T23:37:14+00:00</updated>
<author>
<name>zeertzjq</name>
<email>zeertzjq@outlook.com</email>
</author>
<published>2025-03-03T23:37:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=47cfe901d739149f88b6f917fc1f310727700b40'/>
<id>47cfe901d739149f88b6f917fc1f310727700b40</id>
<content type='text'>
Problem:  using global variable for get_insert()/get_lambda_name()
          (after v9.1.1151)
Solution: let the functions return a string_T object instead
          (Yee Cheng Chin)

In vim/vim#16720, `get_insert()` was modified to store a string length in a
global variable to be queried immediately by another `get_insert_len()`
function, which is somewhat fragile. Instead, just have the function
itself return a `string_T` object instead. Also do the same for
`get_lambda_name()` which has similar issues.

closes: vim/vim#16775

https://github.com/vim/vim/commit/0b5fe420715786249cd121d845dbd6a81f962d1b

Co-authored-by: Yee Cheng Chin &lt;ychin.git@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:  using global variable for get_insert()/get_lambda_name()
          (after v9.1.1151)
Solution: let the functions return a string_T object instead
          (Yee Cheng Chin)

In vim/vim#16720, `get_insert()` was modified to store a string length in a
global variable to be queried immediately by another `get_insert_len()`
function, which is somewhat fragile. Instead, just have the function
itself return a `string_T` object instead. Also do the same for
`get_lambda_name()` which has similar issues.

closes: vim/vim#16775

https://github.com/vim/vim/commit/0b5fe420715786249cd121d845dbd6a81f962d1b

Co-authored-by: Yee Cheng Chin &lt;ychin.git@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>fix(api): don't override Vimscript SID (#32610)</title>
<updated>2025-02-25T01:17:51+00:00</updated>
<author>
<name>zeertzjq</name>
<email>zeertzjq@outlook.com</email>
</author>
<published>2025-02-25T01:17:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=095c0876c2010d6160df37cf057f2d0ad2c4501f'/>
<id>095c0876c2010d6160df37cf057f2d0ad2c4501f</id>
<content type='text'>
Problem:  When calling an API from Vimscript to set an option, mapping,
          etc., :verbose shows that it's set from an API client.
Solution: Don't override current_sctx.sc_sid when calling an API from
          Vimscript. Also fix the inverse case where API channel id is
          not set when calling an API from RPC. Move channel id into
          sctx_T to make saving and restoring easier.

Related #8329</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:  When calling an API from Vimscript to set an option, mapping,
          etc., :verbose shows that it's set from an API client.
Solution: Don't override current_sctx.sc_sid when calling an API from
          Vimscript. Also fix the inverse case where API channel id is
          not set when calling an API from RPC. Move channel id into
          sctx_T to make saving and restoring easier.

Related #8329</pre>
</div>
</content>
</entry>
</feed>
