aboutsummaryrefslogtreecommitdiff
path: root/test/functional/editor/defaults_spec.lua
Commit message (Collapse)AuthorAge
* test(harness): migrate away from magic globalsJustin M. Keyes2026-07-21
| | | | | | | | | | | | | | | | | | | | | 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`.
* fix(colorscheme): adjust `StatusLine[NC]` for diagnostics #36719Evgeni Chasnovski2025-11-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: It is desirable for the default statusline to contain colored diagnostics information. However, current `StatusLine` group is purposefully defined as almost inverted `Normal` to "make current window obvious". This makes diagnostic information from `vim.diagnostic.status()` barely visible: it uses established `DiagnosticSignXxx` groups which have colored foreground with lightness close to `StatusLine` background. Also the `StatusLineNC` group is fairly different from `Normal` in order to both "makes window separators clear" and "be different from `CursorLine`". But not as mush different as `StatusLine` because "`StatusLine` and `StatusLineNC` should be clearly different". Solution: Make both `StatusLine` and `StatusLineNC` be slightly closer in lightness to `Normal`. This makes `StatusLine` and `StatusLineNC` groups satisfy their conditions in the following way: - `vim.diagnostic.count()` is readable on `StatusLine` - yes. - `vim.diagnostic.count()` is readable on `StatusLineNC` - yes. - `StatusLine` makes current window obvious - I'd say yes. - `StatusLine` and `StatusLineNC` are clearly different - it depends on the eyes and monitor. The current is clearly better, but the new ones I'd say are still visibly different. - `StatusLineNC` makes window separators clear - I'd say yes, but depends on the eyes and monitor. - `StatuslineNC` is different from `CursorLine` - NO, they are same. Another approach to solve this would be to introduce dedicated `DiagnosticStatuslineXxx` groups to use in `vim.diagnostics.status()`. They can be defined using foreground colors from the same lightness as `Normal`. This would make them readable in `StatusLine`. But not `StatusLineNC`, though.
* test(editor/defaults_spec): fix flakiness (#34752)zeertzjq2025-07-04
|
* feat(terminal)!: include cursor position in TermRequest event data (#31609)Gregory Anders2025-03-05
| | | | | | | | | | | | | | | | | | When a plugin registers a TermRequest handler there is currently no way for the handler to know where the terminal's cursor position was when the sequence was received. This is often useful information, e.g. for OSC 133 sequences which are used to annotate shell prompts. Modify the event data for the TermRequest autocommand to be a table instead of just a string. The "sequence" field of the table contains the sequence string and the "cursor" field contains the cursor position when the sequence was received. To maintain consistency between TermRequest and TermResponse (and to future proof the latter), TermResponse's event data is also updated to be a table with a "sequence" field. BREAKING CHANGE: event data for TermRequest and TermResponse is now a table
* docs: misc (#32258)dundargoc2025-02-17
| | | | | Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com> Co-authored-by: Julian Visser <12615757+justmejulian@users.noreply.github.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* fix(defaults): improve visual search mappings #32378neeshy2025-02-09
| | | | | | | | | | | | | | | | | | Problem: The behavior of the visual search mappings aren't consistent with their normal mode counterparts. - The count isn't considered - Searching with an empty selection will match every character in the buffer - Searching backwards only jumps back when the cursor is positioned at the start of the selection. Solution: - Issue `n` `v:count1` times - Error out and exit visual mode when the selection is empty - Detect when the cursor is not at the start of the selection, and adjust the count accordingly Also, use the search register instead of the more error-prone approach of feeding the entire search string as an expression
* refactor: use nvim.foo.bar format for autocommand groupsMaria José Solano2025-01-14
|
* fix(defaults): don't replace keycodes in Visual search mappings (#31460)zeertzjq2024-12-05
| | | Also remove "silent" to be more consistent with Normal mode search.
* fix(defaults): omit empty line from unimpaired mapping messages (#31347)Marcus Caisey2024-11-25
| | | | | | | | | | | | | | | | | | | | | Problem: The default unimpaired mappings display an empty line after the command's output. This results (with default configuration) in the `Press ENTER or type command to continue` prompt to be displayed, like so: ``` (2 of 16): item2 Press ENTER or type command to continue ``` Solution: The cause is that we're checking the second return value from `pcall(vim.api.nvim_cmd, opts, {})` to determine whether the call was successful. `nvim_cmd` returns an empty string on success, so this value is an empty string in the successful path which we then display. The fix is simple: check the first return value instead which is the "status code" of the call.
* feat(defaults): dot-repeat [<Space> #31186Peter Aronoff2024-11-17
| | | | | | Problem: `[<Space>` and `]<Space>` do not support repetition. Solution: use `operatorfunc` and `g@l` to make these mappings dot repeatable.
* fix(tests): needing two calls to setup a screen is cringebfredl2024-11-14
| | | | | | | | | | Before calling "attach" a screen object is just a dummy container for (row, col) values whose purpose is to be sent as part of the "attach" function call anyway. Just create the screen in an attached state directly. Keep the complete (row, col, options) config together. It is still completely valid to later detach and re-attach as needed, including to another session.
* feat(defaults): unimpaired empty line below/above cursor #30984Yochem van Rosmalen2024-11-04
|
* fix(defaults): omit extraneous info from unimpaired mapping errors (#30983)Gregory Anders2024-10-29
|
* feat(defaults): popupmenu "Open in browser", "Go to definition" #30261Justin M. Keyes2024-09-05
- Use the popup to expose more features such as LSP and gx. - Move the copy/paste items lower in the menu, they are lower priority.