Skip to content

Commit 39e2bad

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 9243d1d + b67f0c8 commit 39e2bad

24 files changed

Lines changed: 380 additions & 185 deletions

runtime/doc/options.txt

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3391,22 +3391,24 @@ A jump table for the options with a short description can be found at |Q_op|.
33913391

33923392
*'fillchars'* *'fcs'*
33933393
'fillchars' 'fcs' string (default "vert:|,fold:-,eob:~")
3394-
global
3394+
global or local to window |global-local|
33953395
{not available when compiled without the |+folding|
33963396
feature}
3397-
Characters to fill the statuslines and vertical separators.
3398-
It is a comma-separated list of items:
3399-
3400-
item default Used for ~
3401-
stl:c ' ' or '^' statusline of the current window
3402-
stlnc:c ' ' or '=' statusline of the non-current windows
3403-
vert:c '|' vertical separators |:vsplit|
3404-
fold:c '-' filling 'foldtext'
3405-
foldopen:c '-' mark the beginning of a fold
3406-
foldclose:c '+' show a closed fold
3407-
foldsep:c '|' open fold middle character
3408-
diff:c '-' deleted lines of the 'diff' option
3409-
eob:c '~' empty lines below the end of a buffer
3397+
Characters to fill the statuslines, vertical separators and special
3398+
lines in the window.
3399+
It is a comma-separated list of items. Each item has a name, a colon
3400+
and the value of that item:
3401+
3402+
item name default Used for ~
3403+
stl ' ' or '^' statusline of the current window
3404+
stlnc ' ' or '=' statusline of the non-current windows
3405+
vert '|' vertical separators |:vsplit|
3406+
fold '-' filling 'foldtext'
3407+
foldopen '-' mark the beginning of a fold
3408+
foldclose '+' show a closed fold
3409+
foldsep '|' open fold middle character
3410+
diff '-' deleted lines of the 'diff' option
3411+
eob '~' empty lines below the end of a buffer
34103412

34113413
Any one that is omitted will fall back to the default. For "stl" and
34123414
"stlnc" the space will be used when there is highlighting, '^' or '='
@@ -3422,13 +3424,13 @@ A jump table for the options with a short description can be found at |Q_op|.
34223424
characters are not supported.
34233425

34243426
The highlighting used for these items:
3425-
item highlight group ~
3426-
stl:c StatusLine |hl-StatusLine|
3427-
stlnc:c StatusLineNC |hl-StatusLineNC|
3428-
vert:c VertSplit |hl-VertSplit|
3429-
fold:c Folded |hl-Folded|
3430-
diff:c DiffDelete |hl-DiffDelete|
3431-
eob:c EndOfBuffer |hl-EndOfBuffer|
3427+
item name highlight group ~
3428+
stl StatusLine |hl-StatusLine|
3429+
stlnc StatusLineNC |hl-StatusLineNC|
3430+
vert VertSplit |hl-VertSplit|
3431+
fold Folded |hl-Folded|
3432+
diff DiffDelete |hl-DiffDelete|
3433+
eob EndOfBuffer |hl-EndOfBuffer|
34323434

34333435
*'fixendofline'* *'fixeol'* *'nofixendofline'* *'nofixeol'*
34343436
'fixendofline' 'fixeol' boolean (default on)

src/drawline.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,14 +1268,14 @@ win_line(
12681268
if (filler_todo > 0)
12691269
{
12701270
// Draw "deleted" diff line(s).
1271-
if (char2cells(fill_diff) > 1)
1271+
if (char2cells(wp->w_fill_chars.diff) > 1)
12721272
{
12731273
c_extra = '-';
12741274
c_final = NUL;
12751275
}
12761276
else
12771277
{
1278-
c_extra = fill_diff;
1278+
c_extra = wp->w_fill_chars.diff;
12791279
c_final = NUL;
12801280
}
12811281
# ifdef FEAT_RIGHTLEFT
@@ -1352,7 +1352,7 @@ win_line(
13521352
#endif
13531353
)
13541354
{
1355-
screen_line(screen_row, wp->w_wincol, col, -wp->w_width,
1355+
screen_line(wp, screen_row, wp->w_wincol, col, -wp->w_width,
13561356
screen_line_flags);
13571357
// Pretend we have finished updating the window. Except when
13581358
// 'cursorcolumn' is set.
@@ -2863,7 +2863,7 @@ win_line(
28632863
}
28642864
#endif
28652865

2866-
screen_line(screen_row, wp->w_wincol, col,
2866+
screen_line(wp, screen_row, wp->w_wincol, col,
28672867
wp->w_width, screen_line_flags);
28682868
row++;
28692869

@@ -3164,11 +3164,11 @@ win_line(
31643164
)
31653165
{
31663166
#ifdef FEAT_CONCEAL
3167-
screen_line(screen_row, wp->w_wincol, col - boguscols,
3167+
screen_line(wp, screen_row, wp->w_wincol, col - boguscols,
31683168
wp->w_width, screen_line_flags);
31693169
boguscols = 0;
31703170
#else
3171-
screen_line(screen_row, wp->w_wincol, col,
3171+
screen_line(wp, screen_row, wp->w_wincol, col,
31723172
wp->w_width, screen_line_flags);
31733173
#endif
31743174
++row;

src/drawscreen.c

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED)
555555
if (stl_connected(wp))
556556
fillchar = fillchar_status(&attr, wp);
557557
else
558-
fillchar = fillchar_vsep(&attr);
558+
fillchar = fillchar_vsep(&attr, wp);
559559
screen_putchar(fillchar, row, W_ENDCOL(wp), attr);
560560
}
561561
busy = FALSE;
@@ -1038,7 +1038,7 @@ redraw_win_toolbar(win_T *wp)
10381038
}
10391039
wp->w_winbar_items[item_idx].wb_menu = NULL; // end marker
10401040

1041-
screen_line(wp->w_winrow, wp->w_wincol, wp->w_width, wp->w_width, 0);
1041+
screen_line(wp, wp->w_winrow, wp->w_wincol, wp->w_width, wp->w_width, 0);
10421042
}
10431043
#endif
10441044

@@ -1246,7 +1246,8 @@ fold_line(
12461246

12471247
txtcol = col; // remember where text starts
12481248

1249-
// 5. move the text to current_ScreenLine. Fill up with "fill_fold".
1249+
// 5. move the text to current_ScreenLine. Fill up with "fold" from
1250+
// 'fillchars'.
12501251
// Right-left text is put in columns 0 - number-col, normal text is put
12511252
// in columns number-col - window-width.
12521253
col = text_to_screenline(wp, text, col);
@@ -1262,23 +1263,25 @@ fold_line(
12621263
#endif
12631264
)
12641265
{
1266+
int c = wp->w_fill_chars.fold;
1267+
12651268
if (enc_utf8)
12661269
{
1267-
if (fill_fold >= 0x80)
1270+
if (c >= 0x80)
12681271
{
1269-
ScreenLinesUC[off + col] = fill_fold;
1272+
ScreenLinesUC[off + col] = c;
12701273
ScreenLinesC[0][off + col] = 0;
12711274
ScreenLines[off + col] = 0x80; // avoid storing zero
12721275
}
12731276
else
12741277
{
12751278
ScreenLinesUC[off + col] = 0;
1276-
ScreenLines[off + col] = fill_fold;
1279+
ScreenLines[off + col] = c;
12771280
}
12781281
col++;
12791282
}
12801283
else
1281-
ScreenLines[off + col++] = fill_fold;
1284+
ScreenLines[off + col++] = c;
12821285
}
12831286

12841287
if (text != buf)
@@ -1371,7 +1374,8 @@ fold_line(
13711374
}
13721375
#endif
13731376

1374-
screen_line(row + W_WINROW(wp), wp->w_wincol, wp->w_width, wp->w_width, 0);
1377+
screen_line(wp, row + W_WINROW(wp), wp->w_wincol,
1378+
wp->w_width, wp->w_width, 0);
13751379

13761380
// Update w_cline_height and w_cline_folded if the cursor line was
13771381
// updated (saves a call to plines() later).
@@ -2669,10 +2673,10 @@ win_update(win_T *wp)
26692673
if (j > 0 && !wp->w_botfill)
26702674
{
26712675
// Display filler lines at the end of the file.
2672-
if (char2cells(fill_diff) > 1)
2676+
if (char2cells(wp->w_fill_chars.diff) > 1)
26732677
i = '-';
26742678
else
2675-
i = fill_diff;
2679+
i = wp->w_fill_chars.diff;
26762680
if (row + j > wp->w_height)
26772681
j = wp->w_height - row;
26782682
win_draw_end(wp, i, i, TRUE, row, row + (int)j, HLF_DED);
@@ -2683,12 +2687,14 @@ win_update(win_T *wp)
26832687
else if (dollar_vcol == -1)
26842688
wp->w_botline = lnum;
26852689

2686-
// Make sure the rest of the screen is blank
2687-
// write the 'fill_eob' character to rows that aren't part of the file
2690+
// Make sure the rest of the screen is blank.
2691+
// write the "eob" character from 'fillchars' to rows that aren't part
2692+
// of the file.
26882693
if (WIN_IS_POPUP(wp))
26892694
win_draw_end(wp, ' ', ' ', FALSE, row, wp->w_height, HLF_AT);
26902695
else
2691-
win_draw_end(wp, fill_eob, ' ', FALSE, row, wp->w_height, HLF_EOB);
2696+
win_draw_end(wp, wp->w_fill_chars.eob, ' ', FALSE,
2697+
row, wp->w_height, HLF_EOB);
26922698
}
26932699

26942700
#ifdef SYN_TIME_LIMIT
@@ -3026,7 +3032,7 @@ redraw_asap(int type)
30263032
mch_memmove(ScreenLines2 + off,
30273033
screenline2 + r * cols,
30283034
(size_t)cols * sizeof(schar_T));
3029-
screen_line(cmdline_row + r, 0, cols, cols, 0);
3035+
screen_line(curwin, cmdline_row + r, 0, cols, cols, 0);
30303036
}
30313037
ret = 4;
30323038
}

src/globals.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,17 +1382,6 @@ EXTERN char_u *homedir INIT(= NULL);
13821382
// directory is not a local directory, globaldir is NULL.
13831383
EXTERN char_u *globaldir INIT(= NULL);
13841384

1385-
// Characters from 'fillchars' option
1386-
EXTERN int fill_stl INIT(= ' ');
1387-
EXTERN int fill_stlnc INIT(= ' ');
1388-
EXTERN int fill_vert INIT(= ' ');
1389-
EXTERN int fill_fold INIT(= '-');
1390-
EXTERN int fill_foldopen INIT(= '-');
1391-
EXTERN int fill_foldclosed INIT(= '+');
1392-
EXTERN int fill_foldsep INIT(= '|');
1393-
EXTERN int fill_diff INIT(= '-');
1394-
EXTERN int fill_eob INIT(= '~');
1395-
13961385
#ifdef FEAT_FOLDING
13971386
EXTERN int disable_fold_update INIT(= 0);
13981387
#endif

src/gui_gtk_x11.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,6 +1160,7 @@ key_press_event(GtkWidget *widget UNUSED,
11601160
int key;
11611161
guint state;
11621162
char_u *s, *d;
1163+
int ctrl_prefix_added = 0;
11631164

11641165
gui.event_time = event->time;
11651166
key_sym = event->keyval;
@@ -1245,6 +1246,22 @@ key_press_event(GtkWidget *widget UNUSED,
12451246
}
12461247
}
12471248

1249+
#ifdef GDK_KEY_dead_circumflex
1250+
// Belgian Ctrl+[ workaround
1251+
if (len == 0 && key_sym == GDK_KEY_dead_circumflex)
1252+
{
1253+
string[0] = CSI;
1254+
string[1] = KS_MODIFIER;
1255+
string[2] = MOD_MASK_CTRL;
1256+
string[3] = '[';
1257+
len = 4;
1258+
add_to_input_buf(string, len);
1259+
// workaround has to return here, otherwise our fake string[] entries
1260+
// are confusing code downstream
1261+
return TRUE;
1262+
}
1263+
#endif
1264+
12481265
if (len == 0) // Unrecognized key
12491266
return TRUE;
12501267

@@ -1288,6 +1305,8 @@ key_press_event(GtkWidget *widget UNUSED,
12881305
string2[1] = KS_MODIFIER;
12891306
string2[2] = modifiers;
12901307
add_to_input_buf(string2, 3);
1308+
if (modifiers == 0x4)
1309+
ctrl_prefix_added = 1;
12911310
}
12921311

12931312
// Check if the key interrupts.
@@ -1302,6 +1321,15 @@ key_press_event(GtkWidget *widget UNUSED,
13021321
}
13031322
}
13041323

1324+
// workaround for German keyboard, where instead of '[' char we have code
1325+
// sequence of bytes 195, 188 (UTF-8 for "u-umlaut")
1326+
if (ctrl_prefix_added && len == 2
1327+
&& ((int)string[0]) == 195
1328+
&& ((int)string[1]) == 188)
1329+
{
1330+
string[0] = 91; // ASCII('[')
1331+
len = 1;
1332+
}
13051333
add_to_input_buf(string, len);
13061334

13071335
// blank out the pointer if necessary

src/mbyte.c

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4229,8 +4229,7 @@ utf_find_illegal(void)
42294229
#if defined(FEAT_GUI_GTK) || defined(FEAT_SPELL) || defined(PROTO)
42304230
/*
42314231
* Return TRUE if string "s" is a valid utf-8 string.
4232-
* When "end" is NULL stop at the first NUL.
4233-
* When "end" is positive stop there.
4232+
* When "end" is NULL stop at the first NUL. Otherwise stop at "end".
42344233
*/
42354234
int
42364235
utf_valid_string(char_u *s, char_u *end)
@@ -5529,6 +5528,7 @@ f_setcellwidths(typval_T *argvars, typval_T *rettv UNUSED)
55295528
cw_interval_T *table;
55305529
cw_interval_T *cw_table_save;
55315530
size_t cw_table_size_save;
5531+
char *error = NULL;
55325532

55335533
if (in_vim9script() && check_for_list_arg(argvars, 0) == FAIL)
55345534
return;
@@ -5647,31 +5647,37 @@ f_setcellwidths(typval_T *argvars, typval_T *rettv UNUSED)
56475647

56485648
// Check that the new value does not conflict with 'fillchars' or
56495649
// 'listchars'.
5650-
if (set_chars_option(curwin, &p_fcs) != NULL)
5651-
{
5652-
emsg(_(e_conflicts_with_value_of_fillchars));
5653-
cw_table = cw_table_save;
5654-
cw_table_size = cw_table_size_save;
5655-
vim_free(table);
5656-
return;
5657-
}
5650+
if (set_chars_option(curwin, &p_fcs, FALSE) != NULL)
5651+
error = e_conflicts_with_value_of_fillchars;
5652+
else if (set_chars_option(curwin, &p_lcs, FALSE) != NULL)
5653+
error = e_conflicts_with_value_of_listchars;
56585654
else
56595655
{
5660-
tabpage_T *tp;
5661-
win_T *wp;
5656+
tabpage_T *tp;
5657+
win_T *wp;
56625658

56635659
FOR_ALL_TAB_WINDOWS(tp, wp)
56645660
{
5665-
if (set_chars_option(wp, &wp->w_p_lcs) != NULL)
5661+
if (set_chars_option(wp, &wp->w_p_lcs, FALSE) != NULL)
56665662
{
5667-
emsg((e_conflicts_with_value_of_listchars));
5668-
cw_table = cw_table_save;
5669-
cw_table_size = cw_table_size_save;
5670-
vim_free(table);
5671-
return;
5663+
error = e_conflicts_with_value_of_listchars;
5664+
break;
5665+
}
5666+
if (set_chars_option(wp, &wp->w_p_fcs, FALSE) != NULL)
5667+
{
5668+
error = e_conflicts_with_value_of_fillchars;
5669+
break;
56725670
}
56735671
}
56745672
}
5673+
if (error != NULL)
5674+
{
5675+
emsg(_(error));
5676+
cw_table = cw_table_save;
5677+
cw_table_size = cw_table_size_save;
5678+
vim_free(table);
5679+
return;
5680+
}
56755681

56765682
vim_free(cw_table_save);
56775683
}

src/mouse.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2036,7 +2036,7 @@ jump_to_mouse(
20362036
count |= CURSOR_MOVED; // Cursor has moved
20372037

20382038
# ifdef FEAT_FOLDING
2039-
if (mouse_char == fill_foldclosed)
2039+
if (mouse_char == curwin->w_fill_chars.foldclosed)
20402040
count |= MOUSE_FOLD_OPEN;
20412041
else if (mouse_char != ' ')
20422042
count |= MOUSE_FOLD_CLOSE;

0 commit comments

Comments
 (0)