| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
| |
Co-authored-by: Dustin S. <dstackmasta27@gmail.com>
Co-authored-by: Ferenc Fejes <fejes@inf.elte.hu>
Co-authored-by: Maria José Solano <majosolano99@gmail.com>
Co-authored-by: Yochem van Rosmalen <git@yochem.nl>
Co-authored-by: brianhuster <phambinhanctb2004@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
|
|
|
|
|
|
|
|
| |
Problem: `cmdline_show` is emitted unnecessarily each event
loop iteration, because `cmdline_was_last_drawn` is never set.
Solution: Keep track of whether the cmdline was last drawn to avoid
unnecessarily emitting cmdline_show. Set `redraw_state` to
emit `cmdline_pos` when emitting `CursorMovedC`. Only emit
`cmdline_pos` when cmdline was last drawn.
|
|
|
|
|
|
|
|
| |
Problem:
Incremental preview is not allowed on 'nomodifiable' buffers.
Solution:
- Allow preview on 'nomodifiable' buffers.
- Restore the 'modifiable' option in case the preview function changes it.
|
|
|
|
|
| |
Problem: Fix applied in #32033 can be more idiomatic.
Solution: Unset redraw_state instead of cmdbuff.
|
|
|
|
|
|
| |
Problem: If a (vim.ui_attach) cmdline_hide callback triggers a redraw,
it may cause cmdline_show events for an already exited cmdline.
Solution: Avoid emitting cmdline_show event when ccline.cmdbuff is
already NULL. Unset ccline.cmdbuff before emitting cmdline_hide.
|
| |
|
|
|
| |
Cmdline prompts should ignore `cmd_silent`.
|
|
|
|
|
|
|
| |
Problem: Prompts are emitted as messages events, where cmdline events
are more appropriate. The user input is also emitted as
message events in fast context, so cannot be displayed with
vim.ui_attach().
Solution: Prompt for user input through cmdline prompts.
|
|
|
| |
Result of `make iwyu` (after some "fixups").
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Unable to tell what highlight the prompt part of a
cmdline_show event should have, and whether cmdline_hide was
emitted after aborting.
Solution: Add additional arguments hl_id to cmdline_show, and abort to
cmdline_hide.
|
|/
|
|
|
|
|
|
|
|
| |
- Typo/bug in msg_outtrans_long passing string length as "hist" argument.
- Avoid truncating message in msg_outtrans_long with ext_messages (followup to
1097d239c307a10a87fa995c4cfbe5987939e177).
- Remove `_hl` from `msg_keep`, `smsg_keep` as there is no non-`_hl` variant.
- `msg_printf_hl` is removed (identical to `smsg` except it sets
`msg_scroll = true`, seemingly as a caveat to force a more prompt in
cmdline mode). Move this logic to the only the only place this was
used in ex_getln.c.
|
|
|
|
|
|
|
| |
Problem: Two separate try/end wrappers, that only marginally differ by
restoring a few variables. Wrappers that don't restore
previous state are dangerous to use in "api-fast" functions.
Solution: Remove wrappers that don't restore the previous state.
Always use TRY_WRAP.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: Option metadata like list of valid values for an option and
option flags are not listed in the `options.lua` file and are instead
manually defined in C, which means option metadata is split between
several places.
Solution: Put metadata such as list of valid values for an option and
option flags in `options.lua`, and autogenerate the corresponding C
variables and enums.
Supersedes #28659
Co-authored-by: glepnir <glephunter@gmail.com>
|
|
|
|
|
| |
This makes it possible to use HLF_ values directly as highlight id:s
and avoids +1 adjustments especially around messages.
|
|\
| |
| | |
feat(ext_messages): add hl_id to ext_messages chunks
|
| |
| |
| |
| |
| |
| |
| | |
Problem: Highlight group id is not propagated to the end of the message call
stack, where ext_messages are emitted.
Solution: Refactor message functions to pass along highlight group id
instead of attr id.
|
| | |
|
|/
|
|
|
| |
Problem: Inccommand preview callback may flush inaccurate cmdline cursor position.
Solution: Ensure cursor is where it belongs when doing command preview.
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: too many strlen() calls in cmdhist.c
Solution: refactor code and remove strlen() calls
(John Marriott)
closes: vim/vim#15888
https://github.com/vim/vim/commit/8df07d0ca310a55e1540f7d234b536abee49abd4
Co-authored-by: John Marriott <basilisk@internode.on.net>
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: current command completion is a bit limited
Solution: Add the shellcmdline completion type and getmdcomplpat()
function (Ruslan Russkikh).
closes: vim/vim#15823
https://github.com/vim/vim/commit/0407d621bbad020b840ffbbbd25ba023bbc05edd
Co-authored-by: Ruslan Russkikh <dvrussk@yandex.ru>
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: too many strlen() calls in ex_getln.c
Solution: refactor the code to reduce the number of strlen() calls
(John Marriott)
closes: vim/vim#15809
https://github.com/vim/vim/commit/ccf8907570e14396e265b742e51f5089fdf97bf5
Co-authored-by: John Marriott <basilisk@internode.on.net>
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: can set cedit to an invalid value
Solution: Check that the value is a valid key name
(Milly)
closes: vim/vim#15778
https://github.com/vim/vim/commit/25732435c56d762abb260499680939bd8882c708
Co-authored-by: Milly <milly.ca@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: getcmdprompt() implementation can be improved
Solution: Improve and simplify it (h-east)
closes: vim/vim#15743
https://github.com/vim/vim/commit/25876a6cdd439054d0b3f920ccca0a435481de15
Co-authored-by: h-east <h.east.727@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: No way to get prompt for input()/confirm()
Solution: add getcmdprompt() function (Shougo Matsushita)
(Shougo Matsushita)
closes: vim/vim#15667
https://github.com/vim/vim/commit/6908428560a0d6ae27bf7af6fcb6dc362e31926c
Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
Problem: [security]: use-after-free in ex_getln.c
Solution: free pointer p a bit later (John Marriott)
closes: vim/vim#15712
https://github.com/vim/vim/commit/a6de28755ec3fcc86d1ed0b744f1b410a8e9702d
Co-authored-by: John Marriott <basilisk@internode.on.net>
|
|
|
|
|
|
|
|
|
| |
Use the grapheme break algorithm from utf8proc to support grapheme
clusters from recent unicode versions.
Handle variant selector VS16 turning some codepoints into double-width
emoji. This means we need to use ptr2cells rather than char2cells when
possible.
|
|
|
|
|
|
| |
- common_function() has always been in evalfunc.c in Vim
- return_register() has always been in evalfunc.c in Vim
- get_user_input() was moved to ex_getln.c in Vim 8.1.1957
- tv_get_lnum_buf() was moved to typval.c in Vim 8.2.0847
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
Variables are often assigned multiple places in common patterns.
Solution:
Replace these common patterns with different patterns that reduce the
number of assignments.
Use `MAX` and `MIN`:
```c
if (x < y) {
x = y;
}
// -->
x = MAX(x, y);
```
```c
if (x > y) {
x = y;
}
// -->
x = MIN(x, y);
```
Use ternary:
```c
int a;
if (cond) {
a = b;
} els {
a = c;
}
// -->
int a = cond ? b : c;
```
|
|
|
|
|
|
|
|
|
|
| |
Problem: Behavior of CursorMovedC is strange.
Solution: Also trigger when the cmdline has changed.
(zeertzjq)
fixes: vim/vim#15069
closes: vim/vim#15071
https://github.com/vim/vim/commit/8145620a958dbb5c82cf8f8a37556ee1ea501c6d
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: CursorMovedC triggered wrongly with setcmdpos()
(after v9.1.0507)
Solution: Remove the premature triggering. Also don't trigger when
cursor didn't move. (zeertzjq)
closes: vim/vim#15064
https://github.com/vim/vim/commit/bc6f96708e3678dbb27ec4192d87cf94a15d4e9a
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: hard to detect cursor movement in the command line
Solution: Add the CursorMovedC autocommand
(Shougo Matsushita)
closes: vim/vim#15040
https://github.com/vim/vim/commit/d09521476f41dd8dbddb25b7acd0b299f9bf94d3
Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
(#29397)
Problem: getcmdcompltype() interferes with cmdline completion.
Solution: Don't set expand context when it's already set.
(zeertzjq)
closes: vim/vim#15036
https://github.com/vim/vim/commit/a821b609f9bb9daef032fe1cb8fb95995822e367
|
|
|
|
|
| |
revert: "refactor: use S_LEN(s) instead of s, n (#29219)"
This reverts commit c37695a5d5f2e8914fff86f3581bed70b4c85d3c.
|
| |
|
|
|
|
|
|
|
|
|
| |
Problem: Unsetting global variables earlier in #28578 to avoid
recursiveness, caused superfluous or even unlimited
showmode().
Solution: Partly revert #28578 so that the globals are unset at the end
of showmode(), and avoid recursiveness for ext UI by adding a
recursive function guard to each generated UI call that may
call a Lua callback.
|
| |
|
|
|
|
| |
Problem: Unable to update the screen for external cmdline during cmdpreview.
Solution: Flush the cmdline UI before cmdpreview state.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: too many strlen() calls in search.c
Solution: refactor code and remove more strlen() calls,
use explicit variable to remember strlen
(John Marriott)
closes: vim/vim#14796
https://github.com/vim/vim/commit/8c85a2a49acf80e4f53ec51e6ff2a5f3830eeddb
Co-authored-by: John Marriott <basilisk@internode.on.net>
|
|
|
|
|
|
|
|
| |
Problem: Calling :redraw from vim.ui_attach() callback results in
recursive cmdline/message events.
Solution: Avoid recursiveness where possible and replace global "call_buf"
with separate, temporary buffers for each event so that when a Lua
callback for one event fires another event, that does not result
in invalid memory access.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: POSIX function name in exarg struct causes issues
on OpenVMS
Solution: Rename getline member in exarg struct to ea_getline,
remove isinf() workaround for VMS
There are compilers that do not treat well POSIX functions - like
getline - usage in the structs.
Older VMS compilers could digest this... but the newer OpenVMS compilers
( like VSI C x86-64 X7.4-843 (GEM 50XB9) ) cannot deal with these
structs. This could be limited to getline() that is defined via
getdelim() and might not affect all POSIX functions in general - but
avoiding POSIX function names usage in the structs is a "safe side"
practice without compromising the functionality or the code readability.
The previous OpenVMS X86 port used a workaround limiting the compiler
capabilities using __CRTL_VER_OVERRIDE=80400000
In order to make the OpenVMS port future proof, this pull request
proposes a possible solution.
closes: vim/vim#13704
https://github.com/vim/vim/commit/6fdb6280821a822768df5689a5d727e37d38306c
Co-authored-by: Zoltan Arpadffy <zoltan.arpadffy@gmail.com>
|
|
|
|
|
|
| |
Problem: `set_string_option_direct()` contains a separate codepath specifically for setting string options. Not only is that unnecessary code duplication, but it's also limited to only string options.
Solution: Replace `set_string_option_direct()` with `set_option_direct()` which calls `set_option()` under the hood. This reduces code duplication and allows directly setting an option of any type.
|
|
|
|
| |
Problem: Calling :redraw from a timer callback clears 'incsearch' highlighting.
Solution: Re-apply 'incsearch' highlighting if the screen was updated.
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: The ext_cmdline cursor position on the screen seems to rely on
an implicit assumption that the event listener implements a
cmdline window that is made the current window which is
problematic (e.g. breaks 'incsearch' in the actual current
window).
Solution: Remove this assumption and allow nvim_win_set_cursor() to move
the cursor on the screen to a non-current window (previous
commit).
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
(#27636)
Problem: <Del> in cmdline mode doesn't delete composing chars
Solution: Use mb_head_off() and mb_ptr2len() (zeertzjq)
closes: vim/vim#14095
https://github.com/vim/vim/commit/ff2b79d23956263ab0120623c37e0b4498be01db
|
|
|
|
|
|
| |
Problems:
- Illegal bytes after valid UTF-8 char cause utf_cp_*_off() to fail.
- When stream isn't NUL-terminated, utf_cp_*_off() may go over the end.
Solution: Don't go over end of the char of end of the string.
|
|
|
|
|
|
|
|
|
|
|
| |
incomplete (#27448)
Problem: Mechanism to prevent recursive screen updating is incomplete.
Solution: Add "redraw_not_allowed" and set it in build_stl_str_hl().
(issue vim/vim#10952)
https://github.com/vim/vim/commit/471c0fa3eed4f6207d1cb7636970547bfd2eee26
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|