<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rneovim.git/src/nvim/lua/stdlib.c, branch master</title>
<subtitle>Neovim fork with Rahm's personal hacks.</subtitle>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/'/>
<entry>
<title>fix(lua): vim._with({ buf, win }) assertion failure #42244</title>
<updated>2026-10-05T15:57:32+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2026-10-05T15:57:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=7a8b7c04778d334f60766a0c83933b74e4e237b3'/>
<id>7a8b7c04778d334f60766a0c83933b74e4e237b3</id>
<content type='text'>
Problem:
`vim._with({ buf = 0, win = 0 }, f)` fails an assert in ctx_switch().
vim._with() allows `buf` with `win` when `win` shows `buf`, but
nlua_with() passes both, and ctx_switch() takes only one target.

Solution:
Ignore `buf` if `win` is given; the window implies its buffer.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:
`vim._with({ buf = 0, win = 0 }, f)` fails an assert in ctx_switch().
vim._with() allows `buf` with `win` when `win` shows `buf`, but
nlua_with() passes both, and ctx_switch() takes only one target.

Solution:
Ignore `buf` if `win` is given; the window implies its buffer.</pre>
</div>
</content>
</entry>
<entry>
<title>feat(cwd)!: :lcd! (bang), rearrange :bcd/:lcd/… scope precedence #41194</title>
<updated>2026-08-07T08:41:37+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2026-08-07T08:41:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=a4a544032a0ba7a3bb0aea710f9f47b6cd2885db'/>
<id>a4a544032a0ba7a3bb0aea710f9f47b6cd2885db</id>
<content type='text'>
Problem:
- buf-local CWD scope is lower priority than :lcd, which is weird.
  ```
  win &gt; buf &gt; tab &gt; global
  ```
- No way to clear current CWD at a given scope.

Solution:
- Rerrange scope precedence to:
  ```
  buf &gt; win &gt; tab &gt; global
  ```
- Introduce "bang" variants (`:bcd!`/`:lcd!`/`:tcd!`) which clears the
  local CWD for the given scope.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:
- buf-local CWD scope is lower priority than :lcd, which is weird.
  ```
  win &gt; buf &gt; tab &gt; global
  ```
- No way to clear current CWD at a given scope.

Solution:
- Rerrange scope precedence to:
  ```
  buf &gt; win &gt; tab &gt; global
  ```
- Introduce "bang" variants (`:bcd!`/`:lcd!`/`:tcd!`) which clears the
  local CWD for the given scope.</pre>
</div>
</content>
</entry>
<entry>
<title>feat(vim._with): `keepcwd`</title>
<updated>2026-08-06T11:17:07+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2026-08-06T11:16:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=eb19a52b7c235ad5dd86167a6268b1beaf560df8'/>
<id>eb19a52b7c235ad5dd86167a6268b1beaf560df8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>feat(cwd): support explicit chdir (:bcd/:tcd/…) in temp context</title>
<updated>2026-08-06T11:17:07+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2026-08-05T09:20:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=1c1dc0558f784a66fb6d0f7dd3bae8d89274ad64'/>
<id>1c1dc0558f784a66fb6d0f7dd3bae8d89274ad64</id>
<content type='text'>
Problem:
- Explicit `:bcd` (etc.) persists from `nvim_buf_call()` but not from an
  autocmd handler targeting a hidden buf (`LspAttach`, `TermRequest`, …),
  which needs a `vim.schedule()` workaround.
- `vim._with()` is supposed to work as a "sandbox", discarding
  side-effects, but it leaks CWD changes: `:lcd` from a `win` context,
  any chdir from a visible-buffer context.

Solution:
- Explicit :cd/:tcd/:bcd during a temp context persists by default.
  - "Ambient" directory changes ('autochdir', existing win-local CWD,
    etc.) are still undone, as before.
- Add `kCtxKeepDirs`: snapshot/restore the target's full CWD state
  (w/b/tp-local, global, cwd). Used by `vim._with()` and `'inccommand'`,
  which must not leak state.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:
- Explicit `:bcd` (etc.) persists from `nvim_buf_call()` but not from an
  autocmd handler targeting a hidden buf (`LspAttach`, `TermRequest`, …),
  which needs a `vim.schedule()` workaround.
- `vim._with()` is supposed to work as a "sandbox", discarding
  side-effects, but it leaks CWD changes: `:lcd` from a `win` context,
  any chdir from a visible-buffer context.

Solution:
- Explicit :cd/:tcd/:bcd during a temp context persists by default.
  - "Ambient" directory changes ('autochdir', existing win-local CWD,
    etc.) are still undone, as before.
- Add `kCtxKeepDirs`: snapshot/restore the target's full CWD state
  (w/b/tp-local, global, cwd). Used by `vim._with()` and `'inccommand'`,
  which must not leak state.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(lua): vim.regex():match_str abort in Luv callback #41008</title>
<updated>2026-07-27T11:01:54+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2026-07-27T11:01:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=80cd48257721cb4261495131ea806020a309b9c4'/>
<id>80cd48257721cb4261495131ea806020a309b9c4</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(lua): vim.keycode cleanup #40817</title>
<updated>2026-07-18T18:31:36+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2026-07-18T18:31:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=6f5fae3f8cf8b4f8b9baa8a8eaca9deffcf929e5'/>
<id>6f5fae3f8cf8b4f8b9baa8a8eaca9deffcf929e5</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>feat(lua): vim.keycode() gets structured parse result #38636</title>
<updated>2026-07-18T16:20:41+00:00</updated>
<author>
<name>altermo</name>
<email>107814000+altermo@users.noreply.github.com</email>
</author>
<published>2026-07-18T16:20:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=a2dfa195b2b9db3f6c442a131e1c9268989fa70d'/>
<id>a2dfa195b2b9db3f6c442a131e1c9268989fa70d</id>
<content type='text'>
Problems:
1. Can't get individual parts of a key-chord separately: modifiers, key.
2. Can't separate a key-combo into individual key-chords.

Solution:
Enhance `vim.keycode()` to optionally return a structured parse result
as a list of key-chords:
- `key_raw` the key-chord (problem 2)
- `mod` the modifiers of `key_raw` (problem 1)
- `key_orig` the key part of the key-chord, only here if differing from `key`
  (this doesn't solve any of the above mentioned problems, but it may provide
  useful and it's (in terms of code) free)
- `key` a normalized version of `key_orig` (solving problem 1), example(the
  first is `key_orig` and second is `key`): `lt` and `&lt;`, `Bar` and `|` (in
  `&lt;C-Bar&gt;`)</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problems:
1. Can't get individual parts of a key-chord separately: modifiers, key.
2. Can't separate a key-combo into individual key-chords.

Solution:
Enhance `vim.keycode()` to optionally return a structured parse result
as a list of key-chords:
- `key_raw` the key-chord (problem 2)
- `mod` the modifiers of `key_raw` (problem 1)
- `key_orig` the key part of the key-chord, only here if differing from `key`
  (this doesn't solve any of the above mentioned problems, but it may provide
  useful and it's (in terms of code) free)
- `key` a normalized version of `key_orig` (solving problem 1), example(the
  first is `key_orig` and second is `key`): `lt` and `&lt;`, `Bar` and `|` (in
  `&lt;C-Bar&gt;`)</pre>
</div>
</content>
</entry>
<entry>
<title>refactor: unify context-switching concepts</title>
<updated>2026-07-10T01:27:37+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2026-07-09T17:50:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=6bb1aa74e6fe26bffbbdb91878f8f07477c01fcc'/>
<id>6bb1aa74e6fe26bffbbdb91878f8f07477c01fcc</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>refactor: simplify aucmd_restbuf usage #39879</title>
<updated>2026-05-19T09:09:23+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2026-05-19T09:09:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=16d17c50bbccc0c3195656f09660babf45b5f803'/>
<id>16d17c50bbccc0c3195656f09660babf45b5f803</id>
<content type='text'>
Problem:
`aucmd_restbuf` must be guarded in case `aucmd_prepbuf` wasn't called.

Solution:
Update `aucmd_restbuf` to be a no-op if `aucmd_prepbuf` wasn't called.
This requires `aco` to be zero-initialized.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:
`aucmd_restbuf` must be guarded in case `aucmd_prepbuf` wasn't called.

Solution:
Update `aucmd_restbuf` to be a no-op if `aucmd_prepbuf` wasn't called.
This requires `aco` to be zero-initialized.</pre>
</div>
</content>
</entry>
<entry>
<title>fix: vim._with may silence all cmdline-errors #34301</title>
<updated>2026-05-01T14:33:45+00:00</updated>
<author>
<name>altermo</name>
<email>107814000+altermo@users.noreply.github.com</email>
</author>
<published>2026-05-01T14:33:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=a6ea3a1055a374df36cb037ec548698cd9f56fbd'/>
<id>a6ea3a1055a374df36cb037ec548698cd9f56fbd</id>
<content type='text'>
Problem:
vim._with may silence all cmdline-errors if emsg_silent=true, silent=false.

Steps to reproduce:
`nvim --clean -u repro.lua`, then `:echoerr 123`, nothing is shown.

    local api, fn = vim.api, vim.fn
    -- api.nvim_create_autocmd("CursorMovedC", {
    api.nvim_create_autocmd("CmdlineChanged", {
      callback = function(args)
        if args.match ~= ":" then
          return
        end
        -- vim.cmd([[silent! ]])
        vim._with({ emsg_silent = true }, function()
          -- return api.nvim_parse_cmd(fn.getcmdline(), {})
        end)
      end,
    })

Solution:
Force CMOD_SILENT if CMOD_ERRSILENT.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:
vim._with may silence all cmdline-errors if emsg_silent=true, silent=false.

Steps to reproduce:
`nvim --clean -u repro.lua`, then `:echoerr 123`, nothing is shown.

    local api, fn = vim.api, vim.fn
    -- api.nvim_create_autocmd("CursorMovedC", {
    api.nvim_create_autocmd("CmdlineChanged", {
      callback = function(args)
        if args.match ~= ":" then
          return
        end
        -- vim.cmd([[silent! ]])
        vim._with({ emsg_silent = true }, function()
          -- return api.nvim_parse_cmd(fn.getcmdline(), {})
        end)
      end,
    })

Solution:
Force CMOD_SILENT if CMOD_ERRSILENT.</pre>
</div>
</content>
</entry>
</feed>
