commit
2ef72437fc
|
@ -1087,8 +1087,6 @@ int win_lbr_chartabsize(win_T *wp, char_u *line, char_u *s, colnr_T col, int *he
|
|||
}
|
||||
|
||||
if (col == 0 || (col + size + sbrlen > (colnr_T)wp->w_width_inner)) {
|
||||
added = 0;
|
||||
|
||||
if (*p_sbr != NUL) {
|
||||
if (size + sbrlen + numberwidth > (colnr_T)wp->w_width_inner) {
|
||||
// Calculate effective window width.
|
||||
|
|
|
@ -6626,8 +6626,6 @@ call_func(
|
|||
error = ERROR_NONE;
|
||||
executor_call_lua((const char *)funcname, len,
|
||||
argvars, argcount, rettv);
|
||||
} else {
|
||||
error = ERROR_UNKNOWN;
|
||||
}
|
||||
} else if (!builtin_function((const char *)rfname, -1)) {
|
||||
// User defined function.
|
||||
|
@ -11797,7 +11795,6 @@ static void f_haslocaldir(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||
break;
|
||||
case kCdScopeGlobal:
|
||||
// The global scope never has a local directory
|
||||
rettv->vval.v_number = 0;
|
||||
break;
|
||||
case kCdScopeInvalid:
|
||||
// We should never get here
|
||||
|
@ -11909,16 +11906,12 @@ static void f_histget(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||
*/
|
||||
static void f_histnr(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
{
|
||||
int i;
|
||||
|
||||
const char *const history = tv_get_string_chk(&argvars[0]);
|
||||
|
||||
i = history == NULL ? HIST_CMD - 1 : get_histtype(history, strlen(history),
|
||||
false);
|
||||
HistoryType i = history == NULL
|
||||
? HIST_INVALID
|
||||
: get_histtype(history, strlen(history), false);
|
||||
if (i != HIST_INVALID) {
|
||||
i = get_history_idx(i);
|
||||
} else {
|
||||
i = -1;
|
||||
}
|
||||
rettv->vval.v_number = i;
|
||||
}
|
||||
|
@ -17736,9 +17729,7 @@ static void f_strridx(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||
}
|
||||
}
|
||||
|
||||
if (lastmatch == NULL) {
|
||||
rettv->vval.v_number = -1;
|
||||
} else {
|
||||
if (lastmatch != NULL) {
|
||||
rettv->vval.v_number = (varnumber_T)(lastmatch - haystack);
|
||||
}
|
||||
}
|
||||
|
@ -24076,7 +24067,7 @@ void option_last_set_msg(LastSet last_set)
|
|||
MSG_PUTS(_("\n\tLast set from "));
|
||||
MSG_PUTS(p);
|
||||
if (last_set.script_ctx.sc_lnum > 0) {
|
||||
MSG_PUTS(_(" line "));
|
||||
MSG_PUTS(_(line_msg));
|
||||
msg_outnum((long)last_set.script_ctx.sc_lnum);
|
||||
}
|
||||
if (should_free) {
|
||||
|
|
|
@ -2732,16 +2732,7 @@ varnumber_T tv_get_number_chk(const typval_T *const tv, bool *const ret_error)
|
|||
return n;
|
||||
}
|
||||
case VAR_SPECIAL: {
|
||||
switch (tv->vval.v_special) {
|
||||
case kSpecialVarTrue: {
|
||||
return 1;
|
||||
}
|
||||
case kSpecialVarFalse:
|
||||
case kSpecialVarNull: {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
return tv->vval.v_special == kSpecialVarTrue ? 1 : 0;
|
||||
}
|
||||
case VAR_UNKNOWN: {
|
||||
emsgf(_(e_intern2), "tv_get_number(UNKNOWN)");
|
||||
|
|
|
@ -161,6 +161,8 @@ typedef struct command_line_state {
|
|||
int init_topfill;
|
||||
linenr_T old_botline;
|
||||
linenr_T init_botline;
|
||||
int old_empty_rows;
|
||||
int init_empty_rows;
|
||||
pos_T match_start;
|
||||
pos_T match_end;
|
||||
int did_incsearch;
|
||||
|
@ -253,6 +255,7 @@ static uint8_t *command_line_enter(int firstc, long count, int indent)
|
|||
s->init_topline = curwin->w_topline;
|
||||
s->init_topfill = curwin->w_topfill;
|
||||
s->init_botline = curwin->w_botline;
|
||||
s->init_empty_rows = curwin->w_empty_rows;
|
||||
|
||||
if (s->firstc == -1) {
|
||||
s->firstc = NUL;
|
||||
|
@ -275,6 +278,7 @@ static uint8_t *command_line_enter(int firstc, long count, int indent)
|
|||
s->old_topline = curwin->w_topline;
|
||||
s->old_topfill = curwin->w_topfill;
|
||||
s->old_botline = curwin->w_botline;
|
||||
s->old_empty_rows = curwin->w_empty_rows;
|
||||
|
||||
assert(indent >= 0);
|
||||
|
||||
|
@ -449,6 +453,7 @@ static uint8_t *command_line_enter(int firstc, long count, int indent)
|
|||
curwin->w_topline = s->old_topline;
|
||||
curwin->w_topfill = s->old_topfill;
|
||||
curwin->w_botline = s->old_botline;
|
||||
curwin->w_empty_rows = s->old_empty_rows;
|
||||
highlight_match = false;
|
||||
validate_cursor(); // needed for TAB
|
||||
redraw_all_later(SOME_VALID);
|
||||
|
@ -1118,6 +1123,7 @@ static void command_line_next_incsearch(CommandLineState *s, bool next_match)
|
|||
s->old_topline = curwin->w_topline;
|
||||
s->old_topfill = curwin->w_topfill;
|
||||
s->old_botline = curwin->w_botline;
|
||||
s->old_empty_rows = curwin->w_empty_rows;
|
||||
update_screen(NOT_VALID);
|
||||
redrawcmdline();
|
||||
} else {
|
||||
|
@ -1243,6 +1249,7 @@ static int command_line_handle_key(CommandLineState *s)
|
|||
s->old_topline = s->init_topline;
|
||||
s->old_topfill = s->init_topfill;
|
||||
s->old_botline = s->init_botline;
|
||||
s->old_empty_rows = s->init_empty_rows;
|
||||
}
|
||||
redrawcmd();
|
||||
} else if (ccline.cmdlen == 0 && s->c != Ctrl_W
|
||||
|
@ -1876,6 +1883,7 @@ static int command_line_changed(CommandLineState *s)
|
|||
curwin->w_topline = s->old_topline;
|
||||
curwin->w_topfill = s->old_topfill;
|
||||
curwin->w_botline = s->old_botline;
|
||||
curwin->w_empty_rows = s->old_empty_rows;
|
||||
changed_cline_bef_curs();
|
||||
update_topline();
|
||||
|
||||
|
|
|
@ -3106,7 +3106,7 @@ int do_map(int maptype, char_u *arg, int mode, bool is_abbrev)
|
|||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
result = 1; // invalid arguments
|
||||
// invalid arguments
|
||||
goto free_and_return;
|
||||
default:
|
||||
assert(false && "Unknown return code from str_to_mapargs!");
|
||||
|
|
|
@ -1059,6 +1059,8 @@ EXTERN char_u e_floatexchange[] INIT(=N_(
|
|||
EXTERN char top_bot_msg[] INIT(= N_("search hit TOP, continuing at BOTTOM"));
|
||||
EXTERN char bot_top_msg[] INIT(= N_("search hit BOTTOM, continuing at TOP"));
|
||||
|
||||
EXTERN char line_msg[] INIT(= N_(" line "));
|
||||
|
||||
// For undo we need to know the lowest time possible.
|
||||
EXTERN time_t starttime;
|
||||
|
||||
|
|
|
@ -1238,17 +1238,14 @@ static int read_sal_section(FILE *fd, slang_T *slang)
|
|||
p = xmalloc(1);
|
||||
p[0] = NUL;
|
||||
smp->sm_lead = p;
|
||||
smp->sm_lead_w = mb_str2wide(smp->sm_lead);
|
||||
smp->sm_leadlen = 0;
|
||||
smp->sm_oneof = NULL;
|
||||
smp->sm_oneof_w = NULL;
|
||||
smp->sm_rules = p;
|
||||
smp->sm_to = NULL;
|
||||
if (has_mbyte) {
|
||||
smp->sm_lead_w = mb_str2wide(smp->sm_lead);
|
||||
smp->sm_leadlen = 0;
|
||||
smp->sm_oneof_w = NULL;
|
||||
smp->sm_to_w = NULL;
|
||||
}
|
||||
++gap->ga_len;
|
||||
smp->sm_to_w = NULL;
|
||||
gap->ga_len++;
|
||||
}
|
||||
|
||||
// Fill the first-index table.
|
||||
|
@ -1713,7 +1710,6 @@ read_tree_node (
|
|||
if (c == BY_NOFLAGS && !prefixtree) {
|
||||
// No flags, all regions.
|
||||
idxs[idx] = 0;
|
||||
c = 0;
|
||||
} else if (c != BY_INDEX) {
|
||||
if (prefixtree) {
|
||||
// Read the optional pflags byte, the prefix ID and the
|
||||
|
|
|
@ -2537,8 +2537,6 @@ parse_match(
|
|||
tagp->command_end = p;
|
||||
if (p > tagp->command && p[-1] == '|') {
|
||||
tagp->command_end = p - 1; // drop trailing bar
|
||||
} else {
|
||||
tagp->command_end = p;
|
||||
}
|
||||
p += 2; // skip ";\""
|
||||
if (*p++ == TAB) {
|
||||
|
|
|
@ -58,6 +58,14 @@ func Test_gF()
|
|||
call assert_equal('Xfile', bufname('%'))
|
||||
call assert_equal(3, getcurpos()[1])
|
||||
|
||||
enew!
|
||||
call setline(1, ['one', 'the Xfile line 2, and more', 'three'])
|
||||
w! Xfile2
|
||||
normal 2GfX
|
||||
normal gF
|
||||
call assert_equal('Xfile', bufname('%'))
|
||||
call assert_equal(2, getcurpos()[1])
|
||||
|
||||
set isfname&
|
||||
call delete('Xfile')
|
||||
call delete('Xfile2')
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
" Test for the search command
|
||||
|
||||
source shared.vim
|
||||
source screendump.vim
|
||||
|
||||
func Test_search_cmdline()
|
||||
" See test/functional/legacy/search_spec.lua
|
||||
|
@ -549,6 +550,36 @@ func Test_incsearch_with_change()
|
|||
call delete('Xis_change_script')
|
||||
endfunc
|
||||
|
||||
func Test_incsearch_scrolling()
|
||||
if !CanRunVimInTerminal()
|
||||
return
|
||||
endif
|
||||
call assert_equal(0, &scrolloff)
|
||||
call writefile([
|
||||
\ 'let dots = repeat(".", 120)',
|
||||
\ 'set incsearch cmdheight=2 scrolloff=0',
|
||||
\ 'call setline(1, [dots, dots, dots, "", "target", dots, dots])',
|
||||
\ 'normal gg',
|
||||
\ 'redraw',
|
||||
\ ], 'Xscript')
|
||||
let buf = RunVimInTerminal('-S Xscript', {'rows': 9, 'cols': 70})
|
||||
" Need to send one key at a time to force a redraw
|
||||
call term_sendkeys(buf, '/')
|
||||
sleep 100m
|
||||
call term_sendkeys(buf, 't')
|
||||
sleep 100m
|
||||
call term_sendkeys(buf, 'a')
|
||||
sleep 100m
|
||||
call term_sendkeys(buf, 'r')
|
||||
sleep 100m
|
||||
call term_sendkeys(buf, 'g')
|
||||
call VerifyScreenDump(buf, 'Test_incsearch_scrolling_01', {})
|
||||
|
||||
call term_sendkeys(buf, "\<Esc>")
|
||||
call StopVimInTerminal(buf)
|
||||
call delete('Xscript')
|
||||
endfunc
|
||||
|
||||
func Test_search_undefined_behaviour()
|
||||
if !has("terminal")
|
||||
return
|
||||
|
|
|
@ -6020,10 +6020,20 @@ file_name_in_line (
|
|||
|
||||
if (file_lnum != NULL) {
|
||||
char_u *p;
|
||||
const char *line_english = " line ";
|
||||
const char *line_transl = _(line_msg);
|
||||
|
||||
// Get the number after the file name and a separator character.
|
||||
// Also accept " line 999" with and without the same translation as
|
||||
// used in last_set_msg().
|
||||
p = ptr + len;
|
||||
p = skipwhite(p);
|
||||
if (STRNCMP(p, line_english, STRLEN(line_english)) == 0) {
|
||||
p += STRLEN(line_english);
|
||||
} else if (STRNCMP(p, line_transl, STRLEN(line_transl)) == 0) {
|
||||
p += STRLEN(line_transl);
|
||||
} else {
|
||||
p = skipwhite(p);
|
||||
}
|
||||
if (*p != NUL) {
|
||||
if (!isdigit(*p)) {
|
||||
p++; // skip the separator
|
||||
|
|
Loading…
Reference in New Issue