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.
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
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
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.
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.