mirror of
https://github.com/neovim/neovim.git
synced 2025-09-20 18:28:19 +00:00
Merge branch 'master' into expression-parser
Hoping that could fix the LSAN issue: no idea what it is talking about.
This commit is contained in:
@@ -30,7 +30,7 @@ To control jobs, use the "job…" family of functions: |jobstart()|,
|
|||||||
|
|
||||||
Example: >
|
Example: >
|
||||||
|
|
||||||
function! s:JobHandler(job_id, data, event) dict
|
function! s:OnEvent(job_id, data, event) dict
|
||||||
if a:event == 'stdout'
|
if a:event == 'stdout'
|
||||||
let str = self.shell.' stdout: '.join(a:data)
|
let str = self.shell.' stdout: '.join(a:data)
|
||||||
elseif a:event == 'stderr'
|
elseif a:event == 'stderr'
|
||||||
|
@@ -19,12 +19,11 @@ typedef struct loop {
|
|||||||
MultiQueue *events;
|
MultiQueue *events;
|
||||||
MultiQueue *thread_events;
|
MultiQueue *thread_events;
|
||||||
// Immediate events:
|
// Immediate events:
|
||||||
// "Events that should be processed after exiting uv_run() (to avoid
|
// "Processed after exiting uv_run() (to avoid recursion), but before
|
||||||
// recursion), but before returning from loop_poll_events()."
|
// returning from loop_poll_events()." 502aee690c98
|
||||||
// 502aee690c980fcb3cfcb3f211dcfad06103db46
|
// Practical consequence (for main_loop): these events are processed by
|
||||||
// Practical consequence: these events are processed by
|
|
||||||
// state_enter()..os_inchar()
|
// state_enter()..os_inchar()
|
||||||
// whereas "regular" (main_loop.events) events are processed by
|
// whereas "regular" events (main_loop.events) are processed by
|
||||||
// state_enter()..VimState.execute()
|
// state_enter()..VimState.execute()
|
||||||
// But state_enter()..os_inchar() can be "too early" if you want the event
|
// But state_enter()..os_inchar() can be "too early" if you want the event
|
||||||
// to trigger UI updates and other user-activity-related side-effects.
|
// to trigger UI updates and other user-activity-related side-effects.
|
||||||
|
@@ -3484,10 +3484,17 @@ char_u *skip_range(
|
|||||||
{
|
{
|
||||||
unsigned delim;
|
unsigned delim;
|
||||||
|
|
||||||
while (vim_strchr((char_u *)" \t0123456789.$%'/?-+,;", *cmd) != NULL) {
|
while (vim_strchr((char_u *)" \t0123456789.$%'/?-+,;\\", *cmd) != NULL) {
|
||||||
if (*cmd == '\'') {
|
if (*cmd == '\\') {
|
||||||
if (*++cmd == NUL && ctx != NULL)
|
if (cmd[1] == '?' || cmd[1] == '/' || cmd[1] == '&') {
|
||||||
|
cmd++;
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else if (*cmd == '\'') {
|
||||||
|
if (*++cmd == NUL && ctx != NULL) {
|
||||||
*ctx = EXPAND_NOTHING;
|
*ctx = EXPAND_NOTHING;
|
||||||
|
}
|
||||||
} else if (*cmd == '/' || *cmd == '?') {
|
} else if (*cmd == '/' || *cmd == '?') {
|
||||||
delim = *cmd++;
|
delim = *cmd++;
|
||||||
while (*cmd != NUL && *cmd != delim)
|
while (*cmd != NUL && *cmd != delim)
|
||||||
|
@@ -203,7 +203,6 @@ let s:flaky = [
|
|||||||
\ ]
|
\ ]
|
||||||
|
|
||||||
" Locate Test_ functions and execute them.
|
" Locate Test_ functions and execute them.
|
||||||
set nomore
|
|
||||||
redir @q
|
redir @q
|
||||||
silent function /^Test_
|
silent function /^Test_
|
||||||
redir END
|
redir END
|
||||||
|
@@ -306,3 +306,28 @@ func Test_cmdline_complete_wildoptions()
|
|||||||
call assert_equal(a, b)
|
call assert_equal(a, b)
|
||||||
bw!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" using a leading backslash here
|
||||||
|
set cpo+=C
|
||||||
|
|
||||||
|
func Test_cmdline_search_range()
|
||||||
|
new
|
||||||
|
call setline(1, ['a', 'b', 'c', 'd'])
|
||||||
|
/d
|
||||||
|
1,\/s/b/B/
|
||||||
|
call assert_equal('B', getline(2))
|
||||||
|
|
||||||
|
/a
|
||||||
|
$
|
||||||
|
\?,4s/c/C/
|
||||||
|
call assert_equal('C', getline(3))
|
||||||
|
|
||||||
|
call setline(1, ['a', 'b', 'c', 'd'])
|
||||||
|
%s/c/c/
|
||||||
|
1,\&s/b/B/
|
||||||
|
call assert_equal('B', getline(2))
|
||||||
|
|
||||||
|
bwipe!
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
set cpo&
|
||||||
|
@@ -207,39 +207,73 @@ func! Test_mode()
|
|||||||
normal! 3G
|
normal! 3G
|
||||||
exe "normal i\<F2>\<Esc>"
|
exe "normal i\<F2>\<Esc>"
|
||||||
call assert_equal('i-i', g:current_modes)
|
call assert_equal('i-i', g:current_modes)
|
||||||
|
" i_CTRL-P: Multiple matches
|
||||||
exe "normal i\<C-G>uBa\<C-P>\<F2>\<Esc>u"
|
exe "normal i\<C-G>uBa\<C-P>\<F2>\<Esc>u"
|
||||||
call assert_equal('i-ic', g:current_modes)
|
call assert_equal('i-ic', g:current_modes)
|
||||||
|
" i_CTRL-P: Single match
|
||||||
exe "normal iBro\<C-P>\<F2>\<Esc>u"
|
exe "normal iBro\<C-P>\<F2>\<Esc>u"
|
||||||
call assert_equal('i-ic', g:current_modes)
|
call assert_equal('i-ic', g:current_modes)
|
||||||
|
" i_CTRL-X
|
||||||
exe "normal iBa\<C-X>\<F2>\<Esc>u"
|
exe "normal iBa\<C-X>\<F2>\<Esc>u"
|
||||||
call assert_equal('i-ix', g:current_modes)
|
call assert_equal('i-ix', g:current_modes)
|
||||||
|
" i_CTRL-X CTRL-P: Multiple matches
|
||||||
exe "normal iBa\<C-X>\<C-P>\<F2>\<Esc>u"
|
exe "normal iBa\<C-X>\<C-P>\<F2>\<Esc>u"
|
||||||
call assert_equal('i-ic', g:current_modes)
|
call assert_equal('i-ic', g:current_modes)
|
||||||
|
" i_CTRL-X CTRL-P: Single match
|
||||||
exe "normal iBro\<C-X>\<C-P>\<F2>\<Esc>u"
|
exe "normal iBro\<C-X>\<C-P>\<F2>\<Esc>u"
|
||||||
call assert_equal('i-ic', g:current_modes)
|
call assert_equal('i-ic', g:current_modes)
|
||||||
|
" i_CTRL-X CTRL-P + CTRL-P: Single match
|
||||||
exe "normal iBro\<C-X>\<C-P>\<C-P>\<F2>\<Esc>u"
|
exe "normal iBro\<C-X>\<C-P>\<C-P>\<F2>\<Esc>u"
|
||||||
call assert_equal('i-ic', g:current_modes)
|
call assert_equal('i-ic', g:current_modes)
|
||||||
|
" i_CTRL-X CTRL-L: Multiple matches
|
||||||
|
exe "normal i\<C-X>\<C-L>\<F2>\<Esc>u"
|
||||||
|
call assert_equal('i-ic', g:current_modes)
|
||||||
|
" i_CTRL-X CTRL-L: Single match
|
||||||
|
exe "normal iBlu\<C-X>\<C-L>\<F2>\<Esc>u"
|
||||||
|
call assert_equal('i-ic', g:current_modes)
|
||||||
|
" i_CTRL-P: No match
|
||||||
exe "normal iCom\<C-P>\<F2>\<Esc>u"
|
exe "normal iCom\<C-P>\<F2>\<Esc>u"
|
||||||
call assert_equal('i-ic', g:current_modes)
|
call assert_equal('i-ic', g:current_modes)
|
||||||
|
" i_CTRL-X CTRL-P: No match
|
||||||
exe "normal iCom\<C-X>\<C-P>\<F2>\<Esc>u"
|
exe "normal iCom\<C-X>\<C-P>\<F2>\<Esc>u"
|
||||||
call assert_equal('i-ic', g:current_modes)
|
call assert_equal('i-ic', g:current_modes)
|
||||||
|
" i_CTRL-X CTRL-L: No match
|
||||||
|
exe "normal iabc\<C-X>\<C-L>\<F2>\<Esc>u"
|
||||||
|
call assert_equal('i-ic', g:current_modes)
|
||||||
|
|
||||||
|
" R_CTRL-P: Multiple matches
|
||||||
exe "normal RBa\<C-P>\<F2>\<Esc>u"
|
exe "normal RBa\<C-P>\<F2>\<Esc>u"
|
||||||
call assert_equal('R-Rc', g:current_modes)
|
call assert_equal('R-Rc', g:current_modes)
|
||||||
|
" R_CTRL-P: Single match
|
||||||
exe "normal RBro\<C-P>\<F2>\<Esc>u"
|
exe "normal RBro\<C-P>\<F2>\<Esc>u"
|
||||||
call assert_equal('R-Rc', g:current_modes)
|
call assert_equal('R-Rc', g:current_modes)
|
||||||
|
" R_CTRL-X
|
||||||
exe "normal RBa\<C-X>\<F2>\<Esc>u"
|
exe "normal RBa\<C-X>\<F2>\<Esc>u"
|
||||||
call assert_equal('R-Rx', g:current_modes)
|
call assert_equal('R-Rx', g:current_modes)
|
||||||
|
" R_CTRL-X CTRL-P: Multiple matches
|
||||||
exe "normal RBa\<C-X>\<C-P>\<F2>\<Esc>u"
|
exe "normal RBa\<C-X>\<C-P>\<F2>\<Esc>u"
|
||||||
call assert_equal('R-Rc', g:current_modes)
|
call assert_equal('R-Rc', g:current_modes)
|
||||||
|
" R_CTRL-X CTRL-P: Single match
|
||||||
exe "normal RBro\<C-X>\<C-P>\<F2>\<Esc>u"
|
exe "normal RBro\<C-X>\<C-P>\<F2>\<Esc>u"
|
||||||
call assert_equal('R-Rc', g:current_modes)
|
call assert_equal('R-Rc', g:current_modes)
|
||||||
|
" R_CTRL-X CTRL-P + CTRL-P: Single match
|
||||||
exe "normal RBro\<C-X>\<C-P>\<C-P>\<F2>\<Esc>u"
|
exe "normal RBro\<C-X>\<C-P>\<C-P>\<F2>\<Esc>u"
|
||||||
call assert_equal('R-Rc', g:current_modes)
|
call assert_equal('R-Rc', g:current_modes)
|
||||||
|
" R_CTRL-X CTRL-L: Multiple matches
|
||||||
|
exe "normal R\<C-X>\<C-L>\<F2>\<Esc>u"
|
||||||
|
call assert_equal('R-Rc', g:current_modes)
|
||||||
|
" R_CTRL-X CTRL-L: Single match
|
||||||
|
exe "normal RBlu\<C-X>\<C-L>\<F2>\<Esc>u"
|
||||||
|
call assert_equal('R-Rc', g:current_modes)
|
||||||
|
" R_CTRL-P: No match
|
||||||
exe "normal RCom\<C-P>\<F2>\<Esc>u"
|
exe "normal RCom\<C-P>\<F2>\<Esc>u"
|
||||||
call assert_equal('R-Rc', g:current_modes)
|
call assert_equal('R-Rc', g:current_modes)
|
||||||
|
" R_CTRL-X CTRL-P: No match
|
||||||
exe "normal RCom\<C-X>\<C-P>\<F2>\<Esc>u"
|
exe "normal RCom\<C-X>\<C-P>\<F2>\<Esc>u"
|
||||||
call assert_equal('R-Rc', g:current_modes)
|
call assert_equal('R-Rc', g:current_modes)
|
||||||
|
" R_CTRL-X CTRL-L: No match
|
||||||
|
exe "normal Rabc\<C-X>\<C-L>\<F2>\<Esc>u"
|
||||||
|
call assert_equal('R-Rc', g:current_modes)
|
||||||
|
|
||||||
call assert_equal('n', mode(0))
|
call assert_equal('n', mode(0))
|
||||||
call assert_equal('n', mode(1))
|
call assert_equal('n', mode(1))
|
||||||
|
@@ -167,6 +167,24 @@ static size_t unibi_pre_fmt_str(TUIData *data, unsigned int unibi_index,
|
|||||||
return unibi_run(str, data->params, buf, len);
|
return unibi_run(str, data->params, buf, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Emits some termcodes after Nvim startup, which were observed to slowdown
|
||||||
|
/// rendering during startup in tmux 2.3 (+focus-events). #7649
|
||||||
|
static void terminfo_after_startup_event(void **argv)
|
||||||
|
{
|
||||||
|
UI *ui = argv[0];
|
||||||
|
bool defer = argv[1] != NULL; // clever(?) boolean without malloc() dance.
|
||||||
|
TUIData *data = ui->data;
|
||||||
|
if (defer) { // We're on the main-loop. Now forward to the TUI loop.
|
||||||
|
loop_schedule(data->loop,
|
||||||
|
event_create(terminfo_after_startup_event, 2, ui, NULL));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Enable bracketed paste
|
||||||
|
unibi_out_ext(ui, data->unibi_ext.enable_bracketed_paste);
|
||||||
|
// Enable focus reporting
|
||||||
|
unibi_out_ext(ui, data->unibi_ext.enable_focus_reporting);
|
||||||
|
}
|
||||||
|
|
||||||
static void termname_set_event(void **argv)
|
static void termname_set_event(void **argv)
|
||||||
{
|
{
|
||||||
char *termname = argv[0];
|
char *termname = argv[0];
|
||||||
@@ -244,10 +262,6 @@ static void terminfo_start(UI *ui)
|
|||||||
unibi_out(ui, unibi_enter_ca_mode);
|
unibi_out(ui, unibi_enter_ca_mode);
|
||||||
unibi_out(ui, unibi_keypad_xmit);
|
unibi_out(ui, unibi_keypad_xmit);
|
||||||
unibi_out(ui, unibi_clear_screen);
|
unibi_out(ui, unibi_clear_screen);
|
||||||
// Enable bracketed paste
|
|
||||||
unibi_out_ext(ui, data->unibi_ext.enable_bracketed_paste);
|
|
||||||
// Enable focus reporting
|
|
||||||
unibi_out_ext(ui, data->unibi_ext.enable_focus_reporting);
|
|
||||||
uv_loop_init(&data->write_loop);
|
uv_loop_init(&data->write_loop);
|
||||||
if (data->out_isatty) {
|
if (data->out_isatty) {
|
||||||
uv_tty_init(&data->write_loop, &data->output_handle.tty, data->out_fd, 0);
|
uv_tty_init(&data->write_loop, &data->output_handle.tty, data->out_fd, 0);
|
||||||
@@ -260,6 +274,9 @@ static void terminfo_start(UI *ui)
|
|||||||
uv_pipe_init(&data->write_loop, &data->output_handle.pipe, 0);
|
uv_pipe_init(&data->write_loop, &data->output_handle.pipe, 0);
|
||||||
uv_pipe_open(&data->output_handle.pipe, data->out_fd);
|
uv_pipe_open(&data->output_handle.pipe, data->out_fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
loop_schedule(&main_loop,
|
||||||
|
event_create(terminfo_after_startup_event, 2, ui, ui));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void terminfo_stop(UI *ui)
|
static void terminfo_stop(UI *ui)
|
||||||
@@ -342,7 +359,7 @@ static void tui_main(UIBridgeData *bridge, UI *ui)
|
|||||||
CONTINUE(bridge);
|
CONTINUE(bridge);
|
||||||
|
|
||||||
while (!data->stop) {
|
while (!data->stop) {
|
||||||
loop_poll_events(&tui_loop, -1);
|
loop_poll_events(&tui_loop, -1); // tui_loop.events is never processed
|
||||||
}
|
}
|
||||||
|
|
||||||
ui_bridge_stopped(bridge);
|
ui_bridge_stopped(bridge);
|
||||||
@@ -1620,9 +1637,8 @@ static void augment_terminfo(TUIData *data, const char *term,
|
|||||||
ut, NULL, "\033]12;#%p1%06x\007");
|
ut, NULL, "\033]12;#%p1%06x\007");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Terminals generally ignore private modes that they do not recognize,
|
/// Terminals usually ignore unrecognized private modes, and there is no
|
||||||
/// and there is no known ambiguity with these modes from terminal type to
|
/// known ambiguity with these. So we just set them unconditionally.
|
||||||
/// terminal type, so we can afford to just set these unconditionally.
|
|
||||||
data->unibi_ext.enable_lr_margin = (int)unibi_add_ext_str(ut, NULL,
|
data->unibi_ext.enable_lr_margin = (int)unibi_add_ext_str(ut, NULL,
|
||||||
"\x1b[?69h");
|
"\x1b[?69h");
|
||||||
data->unibi_ext.disable_lr_margin = (int)unibi_add_ext_str(ut, NULL,
|
data->unibi_ext.disable_lr_margin = (int)unibi_add_ext_str(ut, NULL,
|
||||||
@@ -1632,9 +1648,9 @@ static void augment_terminfo(TUIData *data, const char *term,
|
|||||||
data->unibi_ext.disable_bracketed_paste = (int)unibi_add_ext_str(ut, NULL,
|
data->unibi_ext.disable_bracketed_paste = (int)unibi_add_ext_str(ut, NULL,
|
||||||
"\x1b[?2004l");
|
"\x1b[?2004l");
|
||||||
data->unibi_ext.enable_focus_reporting = (int)unibi_add_ext_str(ut, NULL,
|
data->unibi_ext.enable_focus_reporting = (int)unibi_add_ext_str(ut, NULL,
|
||||||
"\x1b[?1004h");
|
rxvt ? "\x1b]777;focus;on\x7" : "\x1b[?1004h");
|
||||||
data->unibi_ext.disable_focus_reporting = (int)unibi_add_ext_str(ut, NULL,
|
data->unibi_ext.disable_focus_reporting = (int)unibi_add_ext_str(ut, NULL,
|
||||||
"\x1b[?1004l");
|
rxvt ? "\x1b]777;focus;off\x7" : "\x1b[?1004l");
|
||||||
data->unibi_ext.enable_mouse = (int)unibi_add_ext_str(ut, NULL,
|
data->unibi_ext.enable_mouse = (int)unibi_add_ext_str(ut, NULL,
|
||||||
"\x1b[?1002h\x1b[?1006h");
|
"\x1b[?1002h\x1b[?1006h");
|
||||||
data->unibi_ext.disable_mouse = (int)unibi_add_ext_str(ut, NULL,
|
data->unibi_ext.disable_mouse = (int)unibi_add_ext_str(ut, NULL,
|
||||||
|
@@ -950,7 +950,7 @@ static const int included_patches[] = {
|
|||||||
// 309,
|
// 309,
|
||||||
308,
|
308,
|
||||||
307,
|
307,
|
||||||
// 306,
|
306,
|
||||||
305,
|
305,
|
||||||
// 304,
|
// 304,
|
||||||
// 303,
|
// 303,
|
||||||
@@ -958,10 +958,10 @@ static const int included_patches[] = {
|
|||||||
// 301,
|
// 301,
|
||||||
300,
|
300,
|
||||||
// 299,
|
// 299,
|
||||||
// 298,
|
298,
|
||||||
297,
|
297,
|
||||||
// 296,
|
// 296,
|
||||||
// 295,
|
295,
|
||||||
294,
|
294,
|
||||||
// 293,
|
// 293,
|
||||||
292,
|
292,
|
||||||
@@ -1085,7 +1085,7 @@ static const int included_patches[] = {
|
|||||||
174,
|
174,
|
||||||
// 173 NA
|
// 173 NA
|
||||||
172,
|
172,
|
||||||
// 171,
|
// 171 NA
|
||||||
// 170 NA
|
// 170 NA
|
||||||
// 169 NA
|
// 169 NA
|
||||||
168,
|
168,
|
||||||
|
Reference in New Issue
Block a user