<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rneovim.git/src, 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>vim-patch:9.1.1288: Using wrong window in ll_resize_stack() (#33397)</title>
<updated>2025-04-08T23:40:55+00:00</updated>
<author>
<name>zeertzjq</name>
<email>zeertzjq@outlook.com</email>
</author>
<published>2025-04-08T23:40:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=c73a827564083b4dadb3a70468466306fb416d08'/>
<id>c73a827564083b4dadb3a70468466306fb416d08</id>
<content type='text'>
Problem:  Using wrong window in ll_resize_stack()
          (after v9.1.1287)
Solution: Use "wp" instead of "curwin", even though they are always the
          same value.  Fix typos in documentation (zeertzjq).

closes: vim/vim#17080

https://github.com/vim/vim/commit/b71f1309a210bf8f61a24f4eda336de64c6f0a07</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:  Using wrong window in ll_resize_stack()
          (after v9.1.1287)
Solution: Use "wp" instead of "curwin", even though they are always the
          same value.  Fix typos in documentation (zeertzjq).

closes: vim/vim#17080

https://github.com/vim/vim/commit/b71f1309a210bf8f61a24f4eda336de64c6f0a07</pre>
</div>
</content>
</entry>
<entry>
<title>fix(editor): respect [+cmd] when executing :drop #33339</title>
<updated>2025-04-08T12:54:32+00:00</updated>
<author>
<name>jyn</name>
<email>github@jyn.dev</email>
</author>
<published>2025-04-08T12:54:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=3647b821ea69ea095ccc4bf8c265df474333a5d5'/>
<id>3647b821ea69ea095ccc4bf8c265df474333a5d5</id>
<content type='text'>
Problem:
Normally, `:drop +41 foo.txt` will open foo.txt with the cursor on line
41. But if foo.txt is already open, it instead is a no-op, even if the
cursor is on a different line.

Steps to reproduce:

    nvim --clean foo.txt
    :drop +30 foo.txt

Solution:
Handle +cmd in ex_drop().</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:
Normally, `:drop +41 foo.txt` will open foo.txt with the cursor on line
41. But if foo.txt is already open, it instead is a no-op, even if the
cursor is on a different line.

Steps to reproduce:

    nvim --clean foo.txt
    :drop +30 foo.txt

Solution:
Handle +cmd in ex_drop().</pre>
</div>
</content>
</entry>
<entry>
<title>fix(display): scroll redrawing doesn't account for virt_lines above fold #33374</title>
<updated>2025-04-08T12:47:18+00:00</updated>
<author>
<name>luukvbaal</name>
<email>luukvbaal@gmail.com</email>
</author>
<published>2025-04-08T12:47:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=5b1561bb717eae8781ff62646c675c7e842e4444'/>
<id>5b1561bb717eae8781ff62646c675c7e842e4444</id>
<content type='text'>
Problem:  Logic computing the new height of the modified area does not
          take into account virtual lines attached to a folded line.

Solution: Remove `hasFolding()` branch and let `plines_win_full()` do its job.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:  Logic computing the new height of the modified area does not
          take into account virtual lines attached to a folded line.

Solution: Remove `hasFolding()` branch and let `plines_win_full()` do its job.</pre>
</div>
</content>
</entry>
<entry>
<title>vim-patch:9.1.1287: quickfix code can be further improved</title>
<updated>2025-04-08T05:06:20+00:00</updated>
<author>
<name>zeertzjq</name>
<email>zeertzjq@outlook.com</email>
</author>
<published>2025-04-08T04:06:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=454abde1aa99fde0e50b65a973f0d2eaabd4dc1e'/>
<id>454abde1aa99fde0e50b65a973f0d2eaabd4dc1e</id>
<content type='text'>
Problem:  quickfix code can be further improved (after v9.1.1283)
Solution: slightly refactor quickfix.c (Hirohito Higashi)

- remove error message output
- adjust comments
- rename functions:
  - qf_init_quickfix_stack() --&gt; qf_init_stack()
  - qf_resize_quickfix_stack() --&gt; qf_resize_stack()
  - qf_resize_stack() --&gt; qf_resize_stack_base()

Now qf_alloc_stack() can handle both quickfix/location lists.

closes: vim/vim#17068

https://github.com/vim/vim/commit/adcfb6caeb1c9c54448fff8d5812c3dca2ba0d03

Co-authored-by: Hirohito Higashi &lt;h.east.727@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:  quickfix code can be further improved (after v9.1.1283)
Solution: slightly refactor quickfix.c (Hirohito Higashi)

- remove error message output
- adjust comments
- rename functions:
  - qf_init_quickfix_stack() --&gt; qf_init_stack()
  - qf_resize_quickfix_stack() --&gt; qf_resize_stack()
  - qf_resize_stack() --&gt; qf_resize_stack_base()

Now qf_alloc_stack() can handle both quickfix/location lists.

closes: vim/vim#17068

https://github.com/vim/vim/commit/adcfb6caeb1c9c54448fff8d5812c3dca2ba0d03

Co-authored-by: Hirohito Higashi &lt;h.east.727@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vim-patch:9.1.1283: quickfix stack is limited to 10 items</title>
<updated>2025-04-08T05:06:19+00:00</updated>
<author>
<name>zeertzjq</name>
<email>zeertzjq@outlook.com</email>
</author>
<published>2025-04-08T03:11:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=00eff4b196521adc35d11c605decacef5bc98fa3'/>
<id>00eff4b196521adc35d11c605decacef5bc98fa3</id>
<content type='text'>
Problem:  quickfix and location-list stack is limited to 10 items
Solution: add the 'chistory' and 'lhistory' options to configure a
          larger quickfix/location list stack
          (64-bitman)

closes: vim/vim#16920

https://github.com/vim/vim/commit/88d41ab270a8390a43da97a903b1a4d76b89d330

Co-authored-by: 64-bitman &lt;60551350+64-bitman@users.noreply.github.com&gt;
Co-authored-by: Hirohito Higashi &lt;h.east.727@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:  quickfix and location-list stack is limited to 10 items
Solution: add the 'chistory' and 'lhistory' options to configure a
          larger quickfix/location list stack
          (64-bitman)

closes: vim/vim#16920

https://github.com/vim/vim/commit/88d41ab270a8390a43da97a903b1a4d76b89d330

Co-authored-by: 64-bitman &lt;60551350+64-bitman@users.noreply.github.com&gt;
Co-authored-by: Hirohito Higashi &lt;h.east.727@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vim-patch:9.1.1253: abort when closing window with attached quickfix data</title>
<updated>2025-04-08T05:06:19+00:00</updated>
<author>
<name>zeertzjq</name>
<email>zeertzjq@outlook.com</email>
</author>
<published>2025-04-08T03:09:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=36d143e70722848855107ff05ab3997857b0c388'/>
<id>36d143e70722848855107ff05ab3997857b0c388</id>
<content type='text'>
Problem:  If win_close() is called with a window that has quickfix stack
          attached to it, the corresponding quickfix buffer will be
          closed and freed after the buffer was already closed. At that
          time curwin-&gt;w_buffer points to NULL, which the CHECK_CURBUF
          will catch and abort if ABORT_ON_ERROR is defined
Solution: in wipe_qf_buffer() temporarily point curwin-&gt;w_buffer back to
          curbuf, the window will be closed anyhow, so it shouldn't
          matter that curbuf-&gt;b_nwindows isn't incremented.

closes: vim/vim#16993
closes: vim/vim#16985

https://github.com/vim/vim/commit/ce80c59bfd3c0087a354ee549639ca60fa192fba

Co-authored-by: Christian Brabandt &lt;cb@256bit.org&gt;
Co-authored-by: Hirohito Higashi &lt;h.east.727@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:  If win_close() is called with a window that has quickfix stack
          attached to it, the corresponding quickfix buffer will be
          closed and freed after the buffer was already closed. At that
          time curwin-&gt;w_buffer points to NULL, which the CHECK_CURBUF
          will catch and abort if ABORT_ON_ERROR is defined
Solution: in wipe_qf_buffer() temporarily point curwin-&gt;w_buffer back to
          curbuf, the window will be closed anyhow, so it shouldn't
          matter that curbuf-&gt;b_nwindows isn't incremented.

closes: vim/vim#16993
closes: vim/vim#16985

https://github.com/vim/vim/commit/ce80c59bfd3c0087a354ee549639ca60fa192fba

Co-authored-by: Christian Brabandt &lt;cb@256bit.org&gt;
Co-authored-by: Hirohito Higashi &lt;h.east.727@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(decor): enable decoration provider in on_start #33337</title>
<updated>2025-04-07T10:58:18+00:00</updated>
<author>
<name>luukvbaal</name>
<email>luukvbaal@gmail.com</email>
</author>
<published>2025-04-07T10:58:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=ca16b54c866bca6d10fc4f60874e6469bd0751cd'/>
<id>ca16b54c866bca6d10fc4f60874e6469bd0751cd</id>
<content type='text'>
Problem:  An on_win-disabled decoration provider is left disabled for
          the on_buf callback during the next redraw (if the provider
          does not subscribe to on_end).

Solution: Move re-activation of the provider from after the on_end
          callback to before the on_start callback.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:  An on_win-disabled decoration provider is left disabled for
          the on_buf callback during the next redraw (if the provider
          does not subscribe to on_end).

Solution: Move re-activation of the provider from after the on_end
          callback to before the on_start callback.</pre>
</div>
</content>
</entry>
<entry>
<title>fix(defaults): keywordprg=:help on Windows #33336</title>
<updated>2025-04-07T09:07:31+00:00</updated>
<author>
<name>Emanuel Krollmann</name>
<email>115734183+Sodastream11@users.noreply.github.com</email>
</author>
<published>2025-04-07T09:07:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=3ebde5ea147c4ba931c72e8d860824d65be50004'/>
<id>3ebde5ea147c4ba931c72e8d860824d65be50004</id>
<content type='text'>
Problem:
As `:h kp` says, the default value for keywordprg
should be ':help' on Windows. It is currently
always ':Man'.

Solution:
Add condition to options.lua which sets keywordprg
to ':help' if running on windows.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:
As `:h kp` says, the default value for keywordprg
should be ':help' on Windows. It is currently
always ':Man'.

Solution:
Add condition to options.lua which sets keywordprg
to ':help' if running on windows.</pre>
</div>
</content>
</entry>
</feed>
