<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rneovim.git/test/functional/lua/ffi_spec.lua, 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>refactor(option): simplify error buffer handling</title>
<updated>2026-09-21T16:29:25+00:00</updated>
<author>
<name>Lewis Russell</name>
<email>lewis6991@gmail.com</email>
</author>
<published>2026-09-21T10:55:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=dc049cf0f98332e181d568d91620390ff2f7506b'/>
<id>dc049cf0f98332e181d568d91620390ff2f7506b</id>
<content type='text'>
Problem: Option validators and setters repeatedly pass error buffers and
their sizes separately. Some setters return messages in static storage.

Solution:

- Add CharBuf for borrowed writable storage, with its length including
  space for a terminating NUL.
- Move option error buffers to the callers that report errors. Preserve
  existing buffer sizes, truncation, and calls that do not need a
  message.
- Consolidate option error formatting and the duplicated code that lists
  valid option values.
- Return error messages directly from do_one_set_option().
- Remove unused arguments from get_option_newval() and
  set_option_value_for().
- Handle legacy TTY assignments in the existing callers and remove the
  redundant compatibility wrapper.
- Reuse CharBuf for Tree-sitter query errors.
- Pass CharBuf through the statusline and statuscolumn builders,
  retaining the buffer sizes provided by their callers, including title
  formatting.

AI-assisted
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem: Option validators and setters repeatedly pass error buffers and
their sizes separately. Some setters return messages in static storage.

Solution:

- Add CharBuf for borrowed writable storage, with its length including
  space for a terminating NUL.
- Move option error buffers to the callers that report errors. Preserve
  existing buffer sizes, truncation, and calls that do not need a
  message.
- Consolidate option error formatting and the duplicated code that lists
  valid option values.
- Return error messages directly from do_one_set_option().
- Remove unused arguments from get_option_newval() and
  set_option_value_for().
- Handle legacy TTY assignments in the existing callers and remove the
  redundant compatibility wrapper.
- Reuse CharBuf for Tree-sitter query errors.
- Pass CharBuf through the statusline and statuscolumn builders,
  retaining the buffer sizes provided by their callers, including title
  formatting.

AI-assisted
</pre>
</div>
</content>
</entry>
<entry>
<title>test(harness): migrate away from magic globals</title>
<updated>2026-07-21T11:22:39+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2026-07-20T15:16:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=6d8c8b18d551d0be0490640c00fabb816727ec10'/>
<id>6d8c8b18d551d0be0490640c00fabb816727ec10</id>
<content type='text'>
Problem:
The magic globals `it`, `describe`, etc., are more trouble than they are
worth.

- Hooking into `after_each` requires `getfenv()` hacks.
- They confuse luals/emmylua, because the top-level `.luarc.json` isn't
  merged with `test/.luarc.json` (apparently a luals limitation?)
- They totally defeat discoverability because the user just has to
  "know" about the various magic symbols.

So they harm DX, which means they serve no purpose at all.

Solution:
- Expose the test API from `testutil`, so tests can call `t.it()`,
  `t.describe()`, etc., in the conventional way.
- Drop `getfenv()` hacks.
- Drop the `setfenv()` injection in `load_chunk`.
- Drop `test/_meta.lua`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:
The magic globals `it`, `describe`, etc., are more trouble than they are
worth.

- Hooking into `after_each` requires `getfenv()` hacks.
- They confuse luals/emmylua, because the top-level `.luarc.json` isn't
  merged with `test/.luarc.json` (apparently a luals limitation?)
- They totally defeat discoverability because the user just has to
  "know" about the various magic symbols.

So they harm DX, which means they serve no purpose at all.

Solution:
- Expose the test API from `testutil`, so tests can call `t.it()`,
  `t.describe()`, etc., in the conventional way.
- Drop `getfenv()` hacks.
- Drop the `setfenv()` injection in `load_chunk`.
- Drop `test/_meta.lua`.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(tui): log chdir failure properly #37591</title>
<updated>2026-01-28T10:44:17+00:00</updated>
<author>
<name>zeertzjq</name>
<email>zeertzjq@outlook.com</email>
</author>
<published>2026-01-28T10:44:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=1f0dbfea2f2ee220da12998ce9ae2bb8e8c3f186'/>
<id>1f0dbfea2f2ee220da12998ce9ae2bb8e8c3f186</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>test: support upvalues in exec_lua</title>
<updated>2024-09-21T15:04:09+00:00</updated>
<author>
<name>Lewis Russell</name>
<email>lewis6991@gmail.com</email>
</author>
<published>2024-08-11T08:27:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=e5c174421df3872df0dd3a676609d1e74dfef6a9'/>
<id>e5c174421df3872df0dd3a676609d1e74dfef6a9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>test: improve test conventions</title>
<updated>2024-04-23T16:17:04+00:00</updated>
<author>
<name>dundargoc</name>
<email>gocdundar@gmail.com</email>
</author>
<published>2024-04-20T15:44:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=052498ed42780a76daea589d063cd8947a894673'/>
<id>052498ed42780a76daea589d063cd8947a894673</id>
<content type='text'>
Specifically, functions that are run in the context of the test runner
are put in module `test/testutil.lua` while the functions that are run
in the context of the test session are put in
`test/functional/testnvim.lua`.

Closes https://github.com/neovim/neovim/issues/27004.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Specifically, functions that are run in the context of the test runner
are put in module `test/testutil.lua` while the functions that are run
in the context of the test session are put in
`test/functional/testnvim.lua`.

Closes https://github.com/neovim/neovim/issues/27004.
</pre>
</div>
</content>
</entry>
<entry>
<title>refactor(test): inject after_each differently</title>
<updated>2024-04-10T14:53:50+00:00</updated>
<author>
<name>Lewis Russell</name>
<email>lewis6991@gmail.com</email>
</author>
<published>2024-04-09T11:26:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=81fc27124b9e1b375e0ce9605ae69c3c2a2d9222'/>
<id>81fc27124b9e1b375e0ce9605ae69c3c2a2d9222</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>test: improve test conventions</title>
<updated>2024-04-08T20:51:00+00:00</updated>
<author>
<name>dundargoc</name>
<email>gocdundar@gmail.com</email>
</author>
<published>2024-04-08T09:03:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=7035125b2b26aa68fcfb7cda39377ac79926a0f9'/>
<id>7035125b2b26aa68fcfb7cda39377ac79926a0f9</id>
<content type='text'>
Work on https://github.com/neovim/neovim/issues/27004.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Work on https://github.com/neovim/neovim/issues/27004.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(api/buffer): fix handling of viewport of non-current buffer</title>
<updated>2024-03-13T06:19:59+00:00</updated>
<author>
<name>bfredl</name>
<email>bjorn.linse@gmail.com</email>
</author>
<published>2024-03-11T12:19:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=08fc1ebbaa49e3110b65bddeed28d2e61a96f5d9'/>
<id>08fc1ebbaa49e3110b65bddeed28d2e61a96f5d9</id>
<content type='text'>
A lot of functions in move.c only worked for curwin, alternatively
took a `wp` arg but still only work if that happens to be curwin.

Refactor those that are needed for update_topline(wp) to work
for any window.

fixes #27723
fixes #27720
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A lot of functions in move.c only worked for curwin, alternatively
took a `wp` arg but still only work if that happens to be curwin.

Refactor those that are needed for update_topline(wp) to work
for any window.

fixes #27723
fixes #27720
</pre>
</div>
</content>
</entry>
<entry>
<title>refactor: format test/*</title>
<updated>2024-01-03T01:09:29+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2024-01-03T01:09:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=04f2f864e270e772c6326cefdf24947f0130e492'/>
<id>04f2f864e270e772c6326cefdf24947f0130e492</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>refactor(options): reduce `findoption()` usage</title>
<updated>2023-12-09T11:54:43+00:00</updated>
<author>
<name>Famiu Haque</name>
<email>famiuhaque@proton.me</email>
</author>
<published>2023-12-07T17:46:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=6346987601a28b00564295ee8be0a8b00d9ff911'/>
<id>6346987601a28b00564295ee8be0a8b00d9ff911</id>
<content type='text'>
Problem: Many places in the code use `findoption()` to access an option using its name, even if the option index is available. This is very slow because it requires looping through the options array over and over.

Solution: Use option index instead of name wherever possible. Also introduce an `OptIndex` enum which contains the index for every option as enum constants, this eliminates the need to pass static option names as strings.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem: Many places in the code use `findoption()` to access an option using its name, even if the option index is available. This is very slow because it requires looping through the options array over and over.

Solution: Use option index instead of name wherever possible. Also introduce an `OptIndex` enum which contains the index for every option as enum constants, this eliminates the need to pass static option names as strings.
</pre>
</div>
</content>
</entry>
</feed>
