Skip to content

Commit d404ddd

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents fa37c18 + 3735f11 commit d404ddd

File tree

15 files changed

+126
-19
lines changed

15 files changed

+126
-19
lines changed

src/change.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1404,12 +1404,19 @@ open_line(
14041404
int vreplace_mode;
14051405
int did_append; // appended a new line
14061406
int saved_pi = curbuf->b_p_pi; // copy of preserveindent setting
1407+
#ifdef FEAT_PROP_POPUP
1408+
int at_eol; // cursor after last character
1409+
#endif
14071410

14081411
// make a copy of the current line so we can mess with it
14091412
saved_line = vim_strsave(ml_get_curline());
14101413
if (saved_line == NULL) // out of memory!
14111414
return FALSE;
14121415

1416+
#ifdef FEAT_PROP_POPUP
1417+
at_eol = curwin->w_cursor.col >= (int)STRLEN(saved_line);
1418+
#endif
1419+
14131420
if (State & VREPLACE_FLAG)
14141421
{
14151422
// With MODE_VREPLACE we make a copy of the next line, which we will be
@@ -2133,7 +2140,7 @@ open_line(
21332140
if ((State & MODE_INSERT) && (State & VREPLACE_FLAG) == 0)
21342141
// Properties after the split move to the next line.
21352142
adjust_props_for_split(curwin->w_cursor.lnum, curwin->w_cursor.lnum,
2136-
curwin->w_cursor.col + 1, 0);
2143+
curwin->w_cursor.col + 1, 0, at_eol);
21372144
#endif
21382145
}
21392146
else

src/charset.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ init_chartabsize_arg(
954954
cts->cts_line = line;
955955
cts->cts_ptr = ptr;
956956
#ifdef FEAT_PROP_POPUP
957-
if (lnum > 0)
957+
if (lnum > 0 && !ignore_text_props)
958958
{
959959
char_u *prop_start;
960960
int count;

src/ex_cmds.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4684,7 +4684,8 @@ ex_substitute(exarg_T *eap)
46844684
last_line = lnum + 1;
46854685
}
46864686
#ifdef FEAT_PROP_POPUP
4687-
adjust_props_for_split(lnum + 1, lnum, plen, 1);
4687+
adjust_props_for_split(lnum + 1, lnum,
4688+
plen, 1, FALSE);
46884689
#endif
46894690
// all line numbers increase
46904691
++sub_firstlnum;

src/ex_getln.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4655,6 +4655,8 @@ open_cmdwin(void)
46554655
// First go back to the original window.
46564656
wp = curwin;
46574657
set_bufref(&bufref, curbuf);
4658+
4659+
skip_win_fix_cursor = TRUE;
46584660
win_goto(old_curwin);
46594661

46604662
// win_goto() may trigger an autocommand that already closes the
@@ -4669,6 +4671,7 @@ open_cmdwin(void)
46694671

46704672
// Restore window sizes.
46714673
win_size_restore(&winsizes);
4674+
skip_win_fix_cursor = FALSE;
46724675
}
46734676

46744677
ga_clear(&winsizes);

src/globals.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,9 @@ EXTERN int popup_visible INIT(= FALSE);
755755
EXTERN int popup_uses_mouse_move INIT(= FALSE);
756756

757757
EXTERN int text_prop_frozen INIT(= 0);
758+
759+
// when TRUE computing the cursor position ignores text properties.
760+
EXTERN int ignore_text_props INIT(= FALSE);
758761
#endif
759762

760763
// When set the popup menu will redraw soon using the pum_win_ values. Do not
@@ -1738,3 +1741,8 @@ EXTERN int channel_need_redraw INIT(= FALSE);
17381741
// While executing a regexp and set to OPTION_MAGIC_ON or OPTION_MAGIC_OFF this
17391742
// overrules p_magic. Otherwise set to OPTION_MAGIC_NOT_SET.
17401743
EXTERN optmagic_T magic_overruled INIT(= OPTION_MAGIC_NOT_SET);
1744+
1745+
#ifdef FEAT_CMDWIN
1746+
// Skip win_fix_cursor() call for 'nosplitscroll' when cmdwin is closed.
1747+
EXTERN int skip_win_fix_cursor INIT(= FALSE);
1748+
#endif

src/indent.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,6 +1289,9 @@ change_indent(
12891289
// for the following tricks we don't want list mode
12901290
save_p_list = curwin->w_p_list;
12911291
curwin->w_p_list = FALSE;
1292+
#ifdef FEAT_PROP_POPUP
1293+
ignore_text_props = TRUE;
1294+
#endif
12921295
vc = getvcol_nolist(&curwin->w_cursor);
12931296
vcol = vc;
12941297

@@ -1440,6 +1443,9 @@ change_indent(
14401443
++start_col;
14411444
}
14421445
}
1446+
#ifdef FEAT_PROP_POPUP
1447+
ignore_text_props = FALSE;
1448+
#endif
14431449

14441450
// For MODE_VREPLACE state, we also have to fix the replace stack. In this
14451451
// case it is always possible because we backspace over the whole line and

src/proto/textprop.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ void f_prop_type_list(typval_T *argvars, typval_T *rettv);
2222
void clear_global_prop_types(void);
2323
void clear_buf_prop_types(buf_T *buf);
2424
int adjust_prop_columns(linenr_T lnum, colnr_T col, int bytes_added, int flags);
25-
void adjust_props_for_split(linenr_T lnum_props, linenr_T lnum_top, int kept, int deleted);
25+
void adjust_props_for_split(linenr_T lnum_props, linenr_T lnum_top, int kept, int deleted, int at_eol);
2626
void prepend_joined_props(char_u *new_props, int propcount, int *props_remaining, linenr_T lnum, int last_line, long col, int removed);
2727
/* vim: set ft=c : */

src/scriptfile.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,6 +1639,9 @@ do_source_ext(
16391639
}
16401640
}
16411641
# endif
1642+
#else
1643+
// Keep the sourcing name/lnum, for recursive calls.
1644+
estack_push(ETYPE_SCRIPT, fname_exp, 0);
16421645
#endif
16431646

16441647
cookie.conv.vc_type = CONV_NONE; // no conversion
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
|o+0&#ffffff0|n|e| |o|n|e| |o|n|e| @63
2+
|t|w|o| |t|w|o| |t|w|o| @63
3+
@3|└+2&&|─| |V|i|r|t|u|a|l| |t|e|x|t| |b|e|l|o|w| |t|h|e| |2|n|d| |l|i|n|e| +0&&@37
4+
|x@1> @72
5+
|t|h|r|e@1| |t|h|r|e@1| |t|h|r|e@1| @57
6+
|~+0#4040ff13&| @73
7+
|~| @73
8+
|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|3|,|3| @10|A|l@1|

src/testdir/test_cmdline.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2149,7 +2149,7 @@ func Test_wildmenu_pum()
21492149
call VerifyScreenDump(buf, 'Test_wildmenu_pum_13', {})
21502150

21512151
" Directory name completion
2152-
call mkdir('Xnamedir/XdirA/XdirB', 'p')
2152+
call mkdir('Xnamedir/XdirA/XdirB', 'pR')
21532153
call writefile([], 'Xnamedir/XfileA')
21542154
call writefile([], 'Xnamedir/XdirA/XfileB')
21552155
call writefile([], 'Xnamedir/XdirA/XdirB/XfileC')
@@ -2229,7 +2229,7 @@ func Test_wildmenu_pum()
22292229
call VerifyScreenDump(buf, 'Test_wildmenu_pum_31', {})
22302230

22312231
" Tests a directory name contained full-width characters.
2232-
call mkdir('Xnamedir/あいう', 'pR')
2232+
call mkdir('Xnamedir/あいう', 'p')
22332233
call writefile([], 'Xnamedir/あいう/abc')
22342234
call writefile([], 'Xnamedir/あいう/xyz')
22352235
call writefile([], 'Xnamedir/あいう/123')

0 commit comments

Comments
 (0)