Mercurial > vim
annotate src/drawline.c @ 32078:615964c77be3 v9.0.1370
patch 9.0.1370: crash when using a NULL object
Commit: https://github.com/vim/vim/commit/c3f971f28989fde7d94b45957496fecd6e6f2177
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Mar 2 17:38:33 2023 +0000
patch 9.0.1370: crash when using a NULL object
Problem: Crash when using a NULL object. (Ernie Rael)
Solution: Check for NULL and give an error message. (closes https://github.com/vim/vim/issues/12083)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 02 Mar 2023 18:45:08 +0100 |
parents | a7801ecf7df9 |
children | fe1550f920d8 |
rev | line source |
---|---|
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1 /* vi:set ts=8 sts=4 sw=4 noet: |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2 * |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3 * VIM - Vi IMproved by Bram Moolenaar |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4 * |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
5 * Do ":help uganda" in Vim to read copying and usage conditions. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
6 * Do ":help credits" in Vim to see a list of people who contributed. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
7 * See README.txt for an overview of the Vim source code. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
8 */ |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
9 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
10 /* |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
11 * drawline.c: Functions for drawing window lines on the screen. |
29808
3035901eceb7
patch 9.0.0243: text properties "below" sort differently on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents:
29740
diff
changeset
|
12 * This is the middle level, drawscreen.c is the higher level and screen.c the |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
13 * lower level. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
14 */ |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
15 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
16 #include "vim.h" |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
17 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
18 #ifdef FEAT_SYN_HL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
19 /* |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
20 * Advance **color_cols and return TRUE when there are columns to draw. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
21 */ |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
22 static int |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
23 advance_color_col(int vcol, int **color_cols) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
24 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
25 while (**color_cols >= 0 && vcol > **color_cols) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
26 ++*color_cols; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
27 return (**color_cols >= 0); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
28 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
29 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
30 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
31 #ifdef FEAT_SYN_HL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
32 /* |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
33 * Used when 'cursorlineopt' contains "screenline": compute the margins between |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
34 * which the highlighting is used. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
35 */ |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
36 static void |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
37 margin_columns_win(win_T *wp, int *left_col, int *right_col) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
38 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
39 // cache previous calculations depending on w_virtcol |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
40 static int saved_w_virtcol; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
41 static win_T *prev_wp; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
42 static int prev_left_col; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
43 static int prev_right_col; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
44 static int prev_col_off; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
45 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
46 int cur_col_off = win_col_off(wp); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
47 int width1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
48 int width2; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
49 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
50 if (saved_w_virtcol == wp->w_virtcol |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
51 && prev_wp == wp && prev_col_off == cur_col_off) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
52 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
53 *right_col = prev_right_col; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
54 *left_col = prev_left_col; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
55 return; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
56 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
57 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
58 width1 = wp->w_width - cur_col_off; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
59 width2 = width1 + win_col_off2(wp); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
60 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
61 *left_col = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
62 *right_col = width1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
63 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
64 if (wp->w_virtcol >= (colnr_T)width1) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
65 *right_col = width1 + ((wp->w_virtcol - width1) / width2 + 1) * width2; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
66 if (wp->w_virtcol >= (colnr_T)width1 && width2 > 0) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
67 *left_col = (wp->w_virtcol - width1) / width2 * width2 + width1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
68 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
69 // cache values |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
70 prev_left_col = *left_col; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
71 prev_right_col = *right_col; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
72 prev_wp = wp; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
73 saved_w_virtcol = wp->w_virtcol; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
74 prev_col_off = cur_col_off; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
75 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
76 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
77 |
31297
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
78 #if defined(FEAT_SIGNS) || defined(FEAT_QUICKFIX) \ |
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
79 || defined(FEAT_SYN_HL) || defined(FEAT_DIFF) |
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
80 // using an attribute for the whole line |
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
81 # define LINE_ATTR |
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
82 #endif |
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
83 |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
84 // structure with variables passed between win_line() and other functions |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
85 typedef struct { |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
86 int draw_state; // what to draw next |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
87 |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
88 linenr_T lnum; // line number to be drawn |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
89 |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
90 int startrow; // first row in the window to be drawn |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
91 int row; // row in the window, excl w_winrow |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
92 int screen_row; // row on the screen, incl w_winrow |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
93 |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
94 long vcol; // virtual column, before wrapping |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
95 int col; // visual column on screen, after wrapping |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
96 #ifdef FEAT_CONCEAL |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
97 int boguscols; // nonexistent columns added to "col" to force |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
98 // wrapping |
31986
e0e1ba7daaf4
patch 9.0.1325: 'colorcolumn' highlight wrong with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31944
diff
changeset
|
99 int vcol_off_co; // offset for concealed characters |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
100 #endif |
31986
e0e1ba7daaf4
patch 9.0.1325: 'colorcolumn' highlight wrong with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31944
diff
changeset
|
101 int vcol_off_tp; // offset for virtual text |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
102 #ifdef FEAT_SYN_HL |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
103 int draw_color_col; // highlight colorcolumn |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
104 int *color_cols; // pointer to according columns array |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
105 #endif |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
106 int eol_hl_off; // 1 if highlighted char after EOL |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
107 |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
108 unsigned off; // offset in ScreenLines/ScreenAttrs |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
109 |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
110 int win_attr; // background for the whole window, except |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
111 // margins and "~" lines. |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
112 int wcr_attr; // attributes from 'wincolor' |
30395
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
113 #ifdef FEAT_SYN_HL |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
114 int cul_attr; // set when 'cursorline' active |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
115 #endif |
31297
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
116 #ifdef LINE_ATTR |
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
117 int line_attr; // for the whole line, includes 'cursorline' |
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
118 #endif |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
119 |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
120 int screen_line_flags; // flags for screen_line() |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
121 |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
122 int fromcol; // start of inverting |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
123 int tocol; // end of inverting |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
124 |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
125 #ifdef FEAT_LINEBREAK |
30395
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
126 long vcol_sbr; // virtual column after showbreak |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
127 int need_showbreak; // overlong line, skipping first x chars |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
128 int dont_use_showbreak; // do not use 'showbreak' |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
129 #endif |
30397
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
130 #ifdef FEAT_PROP_POPUP |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
131 int text_prop_above_count; |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
132 #endif |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
133 |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
134 // TRUE when 'cursorlineopt' has "screenline" and cursor is in this line |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
135 int cul_screenline; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
136 |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
137 int char_attr; // attributes for the next character |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
138 |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
139 int n_extra; // number of extra bytes |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
140 char_u *p_extra; // string of extra chars, plus NUL, only used |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
141 // when c_extra and c_final are NUL |
30395
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
142 char_u *p_extra_free; // p_extra buffer that needs to be freed |
31119
e2c909e06424
patch 9.0.0894: virtual text property highlight ignores window background
Bram Moolenaar <Bram@vim.org>
parents:
31113
diff
changeset
|
143 int extra_attr; // attributes for p_extra, should be combined |
e2c909e06424
patch 9.0.0894: virtual text property highlight ignores window background
Bram Moolenaar <Bram@vim.org>
parents:
31113
diff
changeset
|
144 // with win_attr if needed |
31323
a93392e93a53
patch 9.0.0995: padding before virtual text is highlighted
Bram Moolenaar <Bram@vim.org>
parents:
31315
diff
changeset
|
145 int n_attr_skip; // chars to skip before using extra_attr |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
146 int c_extra; // extra chars, all the same |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
147 int c_final; // final char, mandatory if set |
31113
6ff733178f8b
patch 9.0.0891: virtual text below after match has wrong highlight
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
148 int extra_for_textprop; // wlv.n_extra set for textprop |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
149 |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
150 // saved "extra" items for when draw_state becomes WL_LINE (again) |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
151 int saved_n_extra; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
152 char_u *saved_p_extra; |
31113
6ff733178f8b
patch 9.0.0891: virtual text below after match has wrong highlight
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
153 int saved_extra_attr; |
31323
a93392e93a53
patch 9.0.0995: padding before virtual text is highlighted
Bram Moolenaar <Bram@vim.org>
parents:
31315
diff
changeset
|
154 int saved_n_attr_skip; |
31113
6ff733178f8b
patch 9.0.0891: virtual text below after match has wrong highlight
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
155 int saved_extra_for_textprop; |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
156 int saved_c_extra; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
157 int saved_c_final; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
158 int saved_char_attr; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
159 |
30383
9126e872893d
patch 9.0.0527: long sign text may overflow buffer
Bram Moolenaar <Bram@vim.org>
parents:
30375
diff
changeset
|
160 char_u extra[NUMBUFLEN + MB_MAXBYTES]; |
9126e872893d
patch 9.0.0527: long sign text may overflow buffer
Bram Moolenaar <Bram@vim.org>
parents:
30375
diff
changeset
|
161 // "%ld " and 'fdc' must fit in here, as well |
9126e872893d
patch 9.0.0527: long sign text may overflow buffer
Bram Moolenaar <Bram@vim.org>
parents:
30375
diff
changeset
|
162 // any text sign |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
163 |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
164 #ifdef FEAT_DIFF |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
165 hlf_T diff_hlf; // type of diff highlighting |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
166 #endif |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
167 int filler_lines; // nr of filler lines to be drawn |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
168 int filler_todo; // nr of filler lines still to do + 1 |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
169 #ifdef FEAT_SIGNS |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
170 sign_attrs_T sattr; |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
171 #endif |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
172 } winlinevars_T; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
173 |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
174 // draw_state values for items that are drawn in sequence: |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
175 #define WL_START 0 // nothing done yet, must be zero |
30645
101f08b49ed3
patch 9.0.0657: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
30635
diff
changeset
|
176 #define WL_CMDLINE (WL_START + 1) // cmdline window column |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
177 #ifdef FEAT_FOLDING |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
178 # define WL_FOLD (WL_CMDLINE + 1) // 'foldcolumn' |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
179 #else |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
180 # define WL_FOLD WL_CMDLINE |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
181 #endif |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
182 #ifdef FEAT_SIGNS |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
183 # define WL_SIGN (WL_FOLD + 1) // column for signs |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
184 #else |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
185 # define WL_SIGN WL_FOLD // column for signs |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
186 #endif |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
187 #define WL_NR (WL_SIGN + 1) // line number |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
188 #ifdef FEAT_LINEBREAK |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
189 # define WL_BRI (WL_NR + 1) // 'breakindent' |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
190 #else |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
191 # define WL_BRI WL_NR |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
192 #endif |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
193 #if defined(FEAT_LINEBREAK) || defined(FEAT_DIFF) |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
194 # define WL_SBR (WL_BRI + 1) // 'showbreak' or 'diff' |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
195 #else |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
196 # define WL_SBR WL_BRI |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
197 #endif |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
198 #define WL_LINE (WL_SBR + 1) // text in the line |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
199 |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
200 #if defined(FEAT_SIGNS) || defined(FEAT_FOLDING) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
201 /* |
26266
365e7f083f02
patch 8.2.3664: cannot adjust sign highlighting for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25778
diff
changeset
|
202 * Return TRUE if CursorLineSign highlight is to be used. |
365e7f083f02
patch 8.2.3664: cannot adjust sign highlighting for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25778
diff
changeset
|
203 */ |
365e7f083f02
patch 8.2.3664: cannot adjust sign highlighting for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25778
diff
changeset
|
204 static int |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
205 use_cursor_line_highlight(win_T *wp, linenr_T lnum) |
26266
365e7f083f02
patch 8.2.3664: cannot adjust sign highlighting for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25778
diff
changeset
|
206 { |
365e7f083f02
patch 8.2.3664: cannot adjust sign highlighting for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25778
diff
changeset
|
207 return wp->w_p_cul |
365e7f083f02
patch 8.2.3664: cannot adjust sign highlighting for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25778
diff
changeset
|
208 && lnum == wp->w_cursor.lnum |
365e7f083f02
patch 8.2.3664: cannot adjust sign highlighting for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25778
diff
changeset
|
209 && (wp->w_p_culopt_flags & CULOPT_NBR); |
365e7f083f02
patch 8.2.3664: cannot adjust sign highlighting for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25778
diff
changeset
|
210 } |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
211 #endif |
26266
365e7f083f02
patch 8.2.3664: cannot adjust sign highlighting for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25778
diff
changeset
|
212 |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
213 |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
214 #ifdef FEAT_FOLDING |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
215 /* |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
216 * Setup for drawing the 'foldcolumn', if there is one. |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
217 */ |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
218 static void |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
219 handle_foldcolumn(win_T *wp, winlinevars_T *wlv) |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
220 { |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
221 int fdc = compute_foldcolumn(wp, 0); |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
222 |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
223 if (fdc <= 0) |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
224 return; |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
225 |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
226 // Allocate a buffer, "wlv->extra[]" may already be in use. |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
227 vim_free(wlv->p_extra_free); |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
228 wlv->p_extra_free = alloc(MAX_MCO * fdc + 1); |
31531
6e24001000ed
patch 9.0.1098: code uses too much indent
Bram Moolenaar <Bram@vim.org>
parents:
31473
diff
changeset
|
229 if (wlv->p_extra_free == NULL) |
6e24001000ed
patch 9.0.1098: code uses too much indent
Bram Moolenaar <Bram@vim.org>
parents:
31473
diff
changeset
|
230 return; |
6e24001000ed
patch 9.0.1098: code uses too much indent
Bram Moolenaar <Bram@vim.org>
parents:
31473
diff
changeset
|
231 |
6e24001000ed
patch 9.0.1098: code uses too much indent
Bram Moolenaar <Bram@vim.org>
parents:
31473
diff
changeset
|
232 wlv->n_extra = (int)fill_foldcolumn(wlv->p_extra_free, |
6e24001000ed
patch 9.0.1098: code uses too much indent
Bram Moolenaar <Bram@vim.org>
parents:
31473
diff
changeset
|
233 wp, FALSE, wlv->lnum); |
6e24001000ed
patch 9.0.1098: code uses too much indent
Bram Moolenaar <Bram@vim.org>
parents:
31473
diff
changeset
|
234 wlv->p_extra_free[wlv->n_extra] = NUL; |
6e24001000ed
patch 9.0.1098: code uses too much indent
Bram Moolenaar <Bram@vim.org>
parents:
31473
diff
changeset
|
235 wlv->p_extra = wlv->p_extra_free; |
6e24001000ed
patch 9.0.1098: code uses too much indent
Bram Moolenaar <Bram@vim.org>
parents:
31473
diff
changeset
|
236 wlv->c_extra = NUL; |
6e24001000ed
patch 9.0.1098: code uses too much indent
Bram Moolenaar <Bram@vim.org>
parents:
31473
diff
changeset
|
237 wlv->c_final = NUL; |
6e24001000ed
patch 9.0.1098: code uses too much indent
Bram Moolenaar <Bram@vim.org>
parents:
31473
diff
changeset
|
238 if (use_cursor_line_highlight(wp, wlv->lnum)) |
6e24001000ed
patch 9.0.1098: code uses too much indent
Bram Moolenaar <Bram@vim.org>
parents:
31473
diff
changeset
|
239 wlv->char_attr = hl_combine_attr(wlv->wcr_attr, HL_ATTR(HLF_CLF)); |
6e24001000ed
patch 9.0.1098: code uses too much indent
Bram Moolenaar <Bram@vim.org>
parents:
31473
diff
changeset
|
240 else |
6e24001000ed
patch 9.0.1098: code uses too much indent
Bram Moolenaar <Bram@vim.org>
parents:
31473
diff
changeset
|
241 wlv->char_attr = hl_combine_attr(wlv->wcr_attr, HL_ATTR(HLF_FC)); |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
242 } |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
243 #endif |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
244 |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
245 #ifdef FEAT_SIGNS |
26266
365e7f083f02
patch 8.2.3664: cannot adjust sign highlighting for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25778
diff
changeset
|
246 /* |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
247 * Get information needed to display the sign in line "wlv->lnum" in window |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
248 * "wp". |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
249 * If "nrcol" is TRUE, the sign is going to be displayed in the number column. |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
250 * Otherwise the sign is going to be displayed in the sign column. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
251 */ |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
252 static void |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
253 get_sign_display_info( |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
254 int nrcol, |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
255 win_T *wp, |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
256 winlinevars_T *wlv) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
257 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
258 int text_sign; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
259 # ifdef FEAT_SIGN_ICONS |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
260 int icon_sign; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
261 # endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
262 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
263 // Draw two cells with the sign value or blank. |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
264 wlv->c_extra = ' '; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
265 wlv->c_final = NUL; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
266 if (nrcol) |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
267 wlv->n_extra = number_width(wp) + 1; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
268 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
269 { |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
270 if (use_cursor_line_highlight(wp, wlv->lnum)) |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
271 wlv->char_attr = hl_combine_attr(wlv->wcr_attr, HL_ATTR(HLF_CLS)); |
26266
365e7f083f02
patch 8.2.3664: cannot adjust sign highlighting for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25778
diff
changeset
|
272 else |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
273 wlv->char_attr = hl_combine_attr(wlv->wcr_attr, HL_ATTR(HLF_SC)); |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
274 wlv->n_extra = 2; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
275 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
276 |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
277 if (wlv->row == wlv->startrow |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
278 #ifdef FEAT_DIFF |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
279 + wlv->filler_lines && wlv->filler_todo <= 0 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
280 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
281 ) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
282 { |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
283 text_sign = (wlv->sattr.sat_text != NULL) ? wlv->sattr.sat_typenr : 0; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
284 # ifdef FEAT_SIGN_ICONS |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
285 icon_sign = (wlv->sattr.sat_icon != NULL) ? wlv->sattr.sat_typenr : 0; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
286 if (gui.in_use && icon_sign != 0) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
287 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
288 // Use the image in this position. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
289 if (nrcol) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
290 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
291 wlv->c_extra = NUL; |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
292 sprintf((char *)wlv->extra, "%-*c ", |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
293 number_width(wp), SIGN_BYTE); |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
294 wlv->p_extra = wlv->extra; |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
295 wlv->n_extra = (int)STRLEN(wlv->p_extra); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
296 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
297 else |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
298 wlv->c_extra = SIGN_BYTE; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
299 # ifdef FEAT_NETBEANS_INTG |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
300 if (netbeans_active() && (buf_signcount(wp->w_buffer, wlv->lnum) |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
301 > 1)) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
302 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
303 if (nrcol) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
304 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
305 wlv->c_extra = NUL; |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
306 sprintf((char *)wlv->extra, "%-*c ", number_width(wp), |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
307 MULTISIGN_BYTE); |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
308 wlv->p_extra = wlv->extra; |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
309 wlv->n_extra = (int)STRLEN(wlv->p_extra); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
310 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
311 else |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
312 wlv->c_extra = MULTISIGN_BYTE; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
313 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
314 # endif |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
315 wlv->c_final = NUL; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
316 wlv->char_attr = icon_sign; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
317 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
318 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
319 # endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
320 if (text_sign != 0) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
321 { |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
322 wlv->p_extra = wlv->sattr.sat_text; |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
323 if (wlv->p_extra != NULL) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
324 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
325 if (nrcol) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
326 { |
30383
9126e872893d
patch 9.0.0527: long sign text may overflow buffer
Bram Moolenaar <Bram@vim.org>
parents:
30375
diff
changeset
|
327 int width = number_width(wp) - 2; |
9126e872893d
patch 9.0.0527: long sign text may overflow buffer
Bram Moolenaar <Bram@vim.org>
parents:
30375
diff
changeset
|
328 int n; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
329 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
330 for (n = 0; n < width; n++) |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
331 wlv->extra[n] = ' '; |
30383
9126e872893d
patch 9.0.0527: long sign text may overflow buffer
Bram Moolenaar <Bram@vim.org>
parents:
30375
diff
changeset
|
332 vim_snprintf((char *)wlv->extra + n, |
9126e872893d
patch 9.0.0527: long sign text may overflow buffer
Bram Moolenaar <Bram@vim.org>
parents:
30375
diff
changeset
|
333 sizeof(wlv->extra) - n, "%s ", wlv->p_extra); |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
334 wlv->p_extra = wlv->extra; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
335 } |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
336 wlv->c_extra = NUL; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
337 wlv->c_final = NUL; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
338 wlv->n_extra = (int)STRLEN(wlv->p_extra); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
339 } |
26266
365e7f083f02
patch 8.2.3664: cannot adjust sign highlighting for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25778
diff
changeset
|
340 |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
341 if (use_cursor_line_highlight(wp, wlv->lnum) |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
342 && wlv->sattr.sat_culhl > 0) |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
343 wlv->char_attr = wlv->sattr.sat_culhl; |
26266
365e7f083f02
patch 8.2.3664: cannot adjust sign highlighting for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25778
diff
changeset
|
344 else |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
345 wlv->char_attr = wlv->sattr.sat_texthl; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
346 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
347 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
348 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
349 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
350 |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
351 /* |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
352 * Display the absolute or relative line number. After the first row fill with |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
353 * blanks when the 'n' flag isn't in 'cpo'. |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
354 */ |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
355 static void |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
356 handle_lnum_col( |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
357 win_T *wp, |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
358 winlinevars_T *wlv, |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
359 int sign_present UNUSED, |
30371
ba7db97776b2
patch 9.0.0521: compiler warns for unused argument in small version
Bram Moolenaar <Bram@vim.org>
parents:
30367
diff
changeset
|
360 int num_attr UNUSED) |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
361 { |
30689
ac8467091916
patch 9.0.0679: tests failing with 'smoothscroll', 'number' and "n" in 'cpo'
Bram Moolenaar <Bram@vim.org>
parents:
30685
diff
changeset
|
362 int has_cpo_n = vim_strchr(p_cpo, CPO_NUMCOL) != NULL; |
30900
51ffb2dedf04
patch 9.0.0784: text prop "above" not right with 'number' and "n" in 'cpo'
Bram Moolenaar <Bram@vim.org>
parents:
30847
diff
changeset
|
363 int lnum_row = wlv->startrow + wlv->filler_lines |
51ffb2dedf04
patch 9.0.0784: text prop "above" not right with 'number' and "n" in 'cpo'
Bram Moolenaar <Bram@vim.org>
parents:
30847
diff
changeset
|
364 #ifdef FEAT_PROP_POPUP |
51ffb2dedf04
patch 9.0.0784: text prop "above" not right with 'number' and "n" in 'cpo'
Bram Moolenaar <Bram@vim.org>
parents:
30847
diff
changeset
|
365 + wlv->text_prop_above_count |
51ffb2dedf04
patch 9.0.0784: text prop "above" not right with 'number' and "n" in 'cpo'
Bram Moolenaar <Bram@vim.org>
parents:
30847
diff
changeset
|
366 #endif |
51ffb2dedf04
patch 9.0.0784: text prop "above" not right with 'number' and "n" in 'cpo'
Bram Moolenaar <Bram@vim.org>
parents:
30847
diff
changeset
|
367 ; |
30689
ac8467091916
patch 9.0.0679: tests failing with 'smoothscroll', 'number' and "n" in 'cpo'
Bram Moolenaar <Bram@vim.org>
parents:
30685
diff
changeset
|
368 |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
369 if ((wp->w_p_nu || wp->w_p_rnu) |
30900
51ffb2dedf04
patch 9.0.0784: text prop "above" not right with 'number' and "n" in 'cpo'
Bram Moolenaar <Bram@vim.org>
parents:
30847
diff
changeset
|
370 && (wlv->row <= lnum_row || !has_cpo_n) |
30691
024e1c1da31f
patch 9.0.0680: tests failing with 'breakindent', 'number' and "n" in 'cpo'
Bram Moolenaar <Bram@vim.org>
parents:
30689
diff
changeset
|
371 // there is no line number in a wrapped line when "n" is in |
024e1c1da31f
patch 9.0.0680: tests failing with 'breakindent', 'number' and "n" in 'cpo'
Bram Moolenaar <Bram@vim.org>
parents:
30689
diff
changeset
|
372 // 'cpoptions', but 'breakindent' assumes it anyway. |
024e1c1da31f
patch 9.0.0680: tests failing with 'breakindent', 'number' and "n" in 'cpo'
Bram Moolenaar <Bram@vim.org>
parents:
30689
diff
changeset
|
373 && !((has_cpo_n |
024e1c1da31f
patch 9.0.0680: tests failing with 'breakindent', 'number' and "n" in 'cpo'
Bram Moolenaar <Bram@vim.org>
parents:
30689
diff
changeset
|
374 #ifdef FEAT_LINEBREAK |
024e1c1da31f
patch 9.0.0680: tests failing with 'breakindent', 'number' and "n" in 'cpo'
Bram Moolenaar <Bram@vim.org>
parents:
30689
diff
changeset
|
375 && !wp->w_p_bri |
024e1c1da31f
patch 9.0.0680: tests failing with 'breakindent', 'number' and "n" in 'cpo'
Bram Moolenaar <Bram@vim.org>
parents:
30689
diff
changeset
|
376 #endif |
024e1c1da31f
patch 9.0.0680: tests failing with 'breakindent', 'number' and "n" in 'cpo'
Bram Moolenaar <Bram@vim.org>
parents:
30689
diff
changeset
|
377 ) && wp->w_skipcol > 0 && wlv->lnum == wp->w_topline)) |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
378 { |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
379 #ifdef FEAT_SIGNS |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
380 // If 'signcolumn' is set to 'number' and a sign is present |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
381 // in 'lnum', then display the sign instead of the line |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
382 // number. |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
383 if ((*wp->w_p_scl == 'n' && *(wp->w_p_scl + 1) == 'u') && sign_present) |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
384 get_sign_display_info(TRUE, wp, wlv); |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
385 else |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
386 #endif |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
387 { |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
388 // Draw the line number (empty space after wrapping). |
30397
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
389 // When there are text properties above the line put the line number |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
390 // below them. |
30900
51ffb2dedf04
patch 9.0.0784: text prop "above" not right with 'number' and "n" in 'cpo'
Bram Moolenaar <Bram@vim.org>
parents:
30847
diff
changeset
|
391 if (wlv->row == lnum_row |
30845
fa3aba805a34
patch 9.0.0757: line number not visisble with 'smoothscroll', 'nu' and 'rnu'
Bram Moolenaar <Bram@vim.org>
parents:
30825
diff
changeset
|
392 && (wp->w_skipcol == 0 || wlv->row > wp->w_winrow |
fa3aba805a34
patch 9.0.0757: line number not visisble with 'smoothscroll', 'nu' and 'rnu'
Bram Moolenaar <Bram@vim.org>
parents:
30825
diff
changeset
|
393 || (wp->w_p_nu && wp->w_p_rnu))) |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
394 { |
30397
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
395 long num; |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
396 char *fmt = "%*ld "; |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
397 |
30397
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
398 if (wp->w_p_nu && !wp->w_p_rnu) |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
399 // 'number' + 'norelativenumber' |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
400 num = (long)wlv->lnum; |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
401 else |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
402 { |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
403 // 'relativenumber', don't use negative numbers |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
404 num = labs((long)get_cursor_rel_lnum(wp, wlv->lnum)); |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
405 if (num == 0 && wp->w_p_nu && wp->w_p_rnu) |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
406 { |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
407 // 'number' + 'relativenumber' |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
408 num = wlv->lnum; |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
409 fmt = "%-*ld "; |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
410 } |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
411 } |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
412 |
30397
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
413 sprintf((char *)wlv->extra, fmt, number_width(wp), num); |
30610
6c6ac189a05f
patch 9.0.0640: cannot scroll by screen line if a line wraps
Bram Moolenaar <Bram@vim.org>
parents:
30509
diff
changeset
|
414 if (wp->w_skipcol > 0 && wlv->startrow == 0) |
30397
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
415 for (wlv->p_extra = wlv->extra; *wlv->p_extra == ' '; |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
416 ++wlv->p_extra) |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
417 *wlv->p_extra = '-'; |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
418 #ifdef FEAT_RIGHTLEFT |
30397
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
419 if (wp->w_p_rl) // reverse line numbers |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
420 { |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
421 char_u *p1, *p2; |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
422 int t; |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
423 |
30397
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
424 // like rl_mirror(), but keep the space at the end |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
425 p2 = skipwhite(wlv->extra); |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
426 p2 = skiptowhite(p2) - 1; |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
427 for (p1 = skipwhite(wlv->extra); p1 < p2; ++p1, --p2) |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
428 { |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
429 t = *p1; |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
430 *p1 = *p2; |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
431 *p2 = t; |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
432 } |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
433 } |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
434 #endif |
30397
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
435 wlv->p_extra = wlv->extra; |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
436 wlv->c_extra = NUL; |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
437 wlv->c_final = NUL; |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
438 } |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
439 else |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
440 { |
30397
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
441 wlv->c_extra = ' '; |
3f2fcc517d79
patch 9.0.0534: line number is displayed at virtual text "above"
Bram Moolenaar <Bram@vim.org>
parents:
30395
diff
changeset
|
442 wlv->c_final = NUL; |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
443 } |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
444 wlv->n_extra = number_width(wp) + 1; |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
445 wlv->char_attr = hl_combine_attr(wlv->wcr_attr, HL_ATTR(HLF_N)); |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
446 #ifdef FEAT_SYN_HL |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
447 // When 'cursorline' is set highlight the line number of |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
448 // the current line differently. |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
449 // When 'cursorlineopt' does not have "line" only |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
450 // highlight the line number itself. |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
451 // TODO: Can we use CursorLine instead of CursorLineNr |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
452 // when CursorLineNr isn't set? |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
453 if (wp->w_p_cul |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
454 && wlv->lnum == wp->w_cursor.lnum |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
455 && (wp->w_p_culopt_flags & CULOPT_NBR) |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
456 && (wlv->row == wlv->startrow + wlv->filler_lines |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
457 || (wlv->row > wlv->startrow + wlv->filler_lines |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
458 && (wp->w_p_culopt_flags & CULOPT_LINE)))) |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
459 wlv->char_attr = hl_combine_attr(wlv->wcr_attr, HL_ATTR(HLF_CLN)); |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
460 #endif |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
461 if (wp->w_p_rnu && wlv->lnum < wp->w_cursor.lnum |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
462 && HL_ATTR(HLF_LNA) != 0) |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
463 // Use LineNrAbove |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
464 wlv->char_attr = hl_combine_attr(wlv->wcr_attr, HL_ATTR(HLF_LNA)); |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
465 if (wp->w_p_rnu && wlv->lnum > wp->w_cursor.lnum |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
466 && HL_ATTR(HLF_LNB) != 0) |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
467 // Use LineNrBelow |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
468 wlv->char_attr = hl_combine_attr(wlv->wcr_attr, HL_ATTR(HLF_LNB)); |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
469 } |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
470 #ifdef FEAT_SIGNS |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
471 if (num_attr) |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
472 wlv->char_attr = num_attr; |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
473 #endif |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
474 } |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
475 } |
30375
e40d150b66cb
patch 9.0.0523: more compiler warnings for arguments in small version
Bram Moolenaar <Bram@vim.org>
parents:
30371
diff
changeset
|
476 |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
477 #ifdef FEAT_LINEBREAK |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
478 static void |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
479 handle_breakindent(win_T *wp, winlinevars_T *wlv) |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
480 { |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
481 if (wp->w_briopt_sbr && wlv->draw_state == WL_BRI - 1 |
30773
fc9993c5835a
patch 9.0.0721: virtual text "above" with padding not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
30767
diff
changeset
|
482 && *get_showbreak_value(wp) != NUL) |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
483 // draw indent after showbreak value |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
484 wlv->draw_state = WL_BRI; |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
485 else if (wp->w_briopt_sbr && wlv->draw_state == WL_SBR) |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
486 // After the showbreak, draw the breakindent |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
487 wlv->draw_state = WL_BRI - 1; |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
488 |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
489 // draw 'breakindent': indent wrapped text accordingly |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
490 if (wlv->draw_state == WL_BRI - 1) |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
491 { |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
492 wlv->draw_state = WL_BRI; |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
493 // if wlv->need_showbreak is set, breakindent also applies |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
494 if (wp->w_p_bri && (wlv->row != wlv->startrow || wlv->need_showbreak) |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
495 # ifdef FEAT_DIFF |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
496 && wlv->filler_lines == 0 |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
497 # endif |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
498 # ifdef FEAT_PROP_POPUP |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
499 && !wlv->dont_use_showbreak |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
500 # endif |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
501 ) |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
502 { |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
503 wlv->char_attr = 0; |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
504 # ifdef FEAT_DIFF |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
505 if (wlv->diff_hlf != (hlf_T)0) |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
506 wlv->char_attr = HL_ATTR(wlv->diff_hlf); |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
507 # endif |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
508 wlv->p_extra = NULL; |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
509 wlv->c_extra = ' '; |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
510 wlv->c_final = NUL; |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
511 wlv->n_extra = get_breakindent_win(wp, |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
512 ml_get_buf(wp->w_buffer, wlv->lnum, FALSE)); |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
513 if (wlv->row == wlv->startrow) |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
514 { |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
515 wlv->n_extra -= win_col_off2(wp); |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
516 if (wlv->n_extra < 0) |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
517 wlv->n_extra = 0; |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
518 } |
30610
6c6ac189a05f
patch 9.0.0640: cannot scroll by screen line if a line wraps
Bram Moolenaar <Bram@vim.org>
parents:
30509
diff
changeset
|
519 if (wp->w_skipcol > 0 && wlv->startrow == 0 |
6c6ac189a05f
patch 9.0.0640: cannot scroll by screen line if a line wraps
Bram Moolenaar <Bram@vim.org>
parents:
30509
diff
changeset
|
520 && wp->w_p_wrap && wp->w_briopt_sbr) |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
521 wlv->need_showbreak = FALSE; |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
522 // Correct end of highlighted area for 'breakindent', |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
523 // required when 'linebreak' is also set. |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
524 if (wlv->tocol == wlv->vcol) |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
525 wlv->tocol += wlv->n_extra; |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
526 } |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
527 } |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
528 } |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
529 #endif |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
530 |
30395
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
531 #if defined(FEAT_LINEBREAK) || defined(FEAT_DIFF) |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
532 static void |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
533 handle_showbreak_and_filler(win_T *wp, winlinevars_T *wlv) |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
534 { |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
535 # ifdef FEAT_DIFF |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
536 if (wlv->filler_todo > 0) |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
537 { |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
538 // Draw "deleted" diff line(s). |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
539 if (char2cells(wp->w_fill_chars.diff) > 1) |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
540 { |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
541 wlv->c_extra = '-'; |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
542 wlv->c_final = NUL; |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
543 } |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
544 else |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
545 { |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
546 wlv->c_extra = wp->w_fill_chars.diff; |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
547 wlv->c_final = NUL; |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
548 } |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
549 # ifdef FEAT_RIGHTLEFT |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
550 if (wp->w_p_rl) |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
551 wlv->n_extra = wlv->col + 1; |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
552 else |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
553 # endif |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
554 wlv->n_extra = wp->w_width - wlv->col; |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
555 wlv->char_attr = HL_ATTR(HLF_DED); |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
556 } |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
557 # endif |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
558 |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
559 # ifdef FEAT_LINEBREAK |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
560 char_u *sbr = get_showbreak_value(wp); |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
561 if (*sbr != NUL && wlv->need_showbreak) |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
562 { |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
563 // Draw 'showbreak' at the start of each broken line. |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
564 wlv->p_extra = sbr; |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
565 wlv->c_extra = NUL; |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
566 wlv->c_final = NUL; |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
567 wlv->n_extra = (int)STRLEN(sbr); |
30614
50b2da7068d6
patch 9.0.0642: breakindent test fails
Bram Moolenaar <Bram@vim.org>
parents:
30610
diff
changeset
|
568 if (wp->w_skipcol == 0 || wlv->startrow != 0 || !wp->w_p_wrap) |
30395
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
569 wlv->need_showbreak = FALSE; |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
570 wlv->vcol_sbr = wlv->vcol + MB_CHARLEN(sbr); |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
571 // Correct end of highlighted area for 'showbreak', |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
572 // required when 'linebreak' is also set. |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
573 if (wlv->tocol == wlv->vcol) |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
574 wlv->tocol += wlv->n_extra; |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
575 // combine 'showbreak' with 'wincolor' |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
576 wlv->char_attr = hl_combine_attr(wlv->win_attr, HL_ATTR(HLF_AT)); |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
577 # ifdef FEAT_SYN_HL |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
578 // combine 'showbreak' with 'cursorline' |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
579 if (wlv->cul_attr != 0) |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
580 wlv->char_attr = hl_combine_attr(wlv->char_attr, wlv->cul_attr); |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
581 # endif |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
582 } |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
583 # endif |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
584 } |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
585 #endif |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
586 |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
587 #if defined(FEAT_PROP_POPUP) || defined(PROTO) |
29690
1a9b3c96ed08
patch 9.0.0185: virtual text does not show if text prop at same position
Bram Moolenaar <Bram@vim.org>
parents:
29688
diff
changeset
|
588 /* |
30205
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
589 * Return the cell size of virtual text after truncation. |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
590 */ |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
591 static int |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
592 textprop_size_after_trunc( |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
593 win_T *wp, |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
594 int flags, // TP_FLAG_ALIGN_* |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
595 int added, |
30741
11875afe85b2
patch 9.0.0705: virtual text truncation does not take padding into account
Bram Moolenaar <Bram@vim.org>
parents:
30713
diff
changeset
|
596 int padding, |
30205
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
597 char_u *text, |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
598 int *n_used_ptr) |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
599 { |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
600 int space = (flags & (TP_FLAG_ALIGN_BELOW | TP_FLAG_ALIGN_ABOVE)) |
30759
b41ccaa6fd84
patch 9.0.0714: with 'nowrap' two virtual text below not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
30749
diff
changeset
|
601 ? wp->w_width - win_col_off(wp) : added; |
30205
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
602 int len = (int)STRLEN(text); |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
603 int strsize = 0; |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
604 int n_used; |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
605 |
30781
82fd47d71971
patch 9.0.0725: virtual text "after" wraps to next line when 'wrap' is off
Bram Moolenaar <Bram@vim.org>
parents:
30777
diff
changeset
|
606 // if the remaining size is to small and 'wrap' is set we wrap anyway and |
82fd47d71971
patch 9.0.0725: virtual text "after" wraps to next line when 'wrap' is off
Bram Moolenaar <Bram@vim.org>
parents:
30777
diff
changeset
|
607 // use the next line |
82fd47d71971
patch 9.0.0725: virtual text "after" wraps to next line when 'wrap' is off
Bram Moolenaar <Bram@vim.org>
parents:
30777
diff
changeset
|
608 if (space < PROP_TEXT_MIN_CELLS && wp->w_p_wrap) |
30205
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
609 space += wp->w_width; |
30773
fc9993c5835a
patch 9.0.0721: virtual text "above" with padding not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
30767
diff
changeset
|
610 if (flags & (TP_FLAG_ALIGN_BELOW | TP_FLAG_ALIGN_ABOVE)) |
30741
11875afe85b2
patch 9.0.0705: virtual text truncation does not take padding into account
Bram Moolenaar <Bram@vim.org>
parents:
30713
diff
changeset
|
611 space -= padding; |
30205
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
612 for (n_used = 0; n_used < len; n_used += (*mb_ptr2len)(text + n_used)) |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
613 { |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
614 int clen = ptr2cells(text + n_used); |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
615 |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
616 if (strsize + clen > space) |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
617 break; |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
618 strsize += clen; |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
619 } |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
620 *n_used_ptr = n_used; |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
621 return strsize; |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
622 } |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
623 |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
624 /* |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
625 * Take care of padding, right-align and truncation of virtual text after a |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
626 * line. |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
627 * if "n_attr" is not NULL then "n_extra" and "p_extra" are adjusted for any |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
628 * padding, right-align and truncation. Otherwise only the size is computed. |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
629 * When "n_attr" is NULL returns the number of screen cells used. |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
630 * Otherwise returns TRUE when drawing continues on the next line. |
29690
1a9b3c96ed08
patch 9.0.0185: virtual text does not show if text prop at same position
Bram Moolenaar <Bram@vim.org>
parents:
29688
diff
changeset
|
631 */ |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
632 int |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
633 text_prop_position( |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
634 win_T *wp, |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
635 textprop_T *tp, |
31257
6ebd92646276
patch 9.0.0962: virtual text below cannot be placed below empty lines
Bram Moolenaar <Bram@vim.org>
parents:
31223
diff
changeset
|
636 int vcol, // current text column |
30749
6fe513996997
patch 9.0.0709: virtual text "after" not correct with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
30741
diff
changeset
|
637 int scr_col, // current screen column |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
638 int *n_extra, // nr of bytes for virtual text |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
639 char_u **p_extra, // virtual text |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
640 int *n_attr, // attribute cells, NULL if not used |
31371
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
641 int *n_attr_skip, // cells to skip attr, NULL if not used |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
642 int do_skip) // skip_cells is not zero |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
643 { |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
644 int right = (tp->tp_flags & TP_FLAG_ALIGN_RIGHT); |
30205
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
645 int above = (tp->tp_flags & TP_FLAG_ALIGN_ABOVE); |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
646 int below = (tp->tp_flags & TP_FLAG_ALIGN_BELOW); |
31584
cfc60c536a2f
patch 9.0.1124: virtual text at a column position is truncated
Bram Moolenaar <Bram@vim.org>
parents:
31531
diff
changeset
|
647 int wrap = tp->tp_col < MAXCOL || (tp->tp_flags & TP_FLAG_WRAP); |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
648 int padding = tp->tp_col == MAXCOL && tp->tp_len > 1 |
31257
6ebd92646276
patch 9.0.0962: virtual text below cannot be placed below empty lines
Bram Moolenaar <Bram@vim.org>
parents:
31223
diff
changeset
|
649 ? tp->tp_len - 1 : 0; |
30749
6fe513996997
patch 9.0.0709: virtual text "after" not correct with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
30741
diff
changeset
|
650 int col_with_padding = scr_col + (below ? 0 : padding); |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
651 int room = wp->w_width - col_with_padding; |
30205
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
652 int before = room; // spaces before the text |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
653 int after = 0; // spaces after the text |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
654 int n_used = *n_extra; |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
655 char_u *l = NULL; |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
656 int strsize = vim_strsize(*p_extra); |
30205
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
657 int cells = wrap ? strsize : textprop_size_after_trunc(wp, |
30741
11875afe85b2
patch 9.0.0705: virtual text truncation does not take padding into account
Bram Moolenaar <Bram@vim.org>
parents:
30713
diff
changeset
|
658 tp->tp_flags, before, padding, *p_extra, &n_used); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
659 |
30205
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
660 if (wrap || right || above || below || padding > 0 || n_used < *n_extra) |
29560
14b139cbec49
patch 9.0.0121: cannot put virtual text after or below a line
Bram Moolenaar <Bram@vim.org>
parents:
29550
diff
changeset
|
661 { |
30767
5dba398584fd
patch 9.0.0718: extra empty line between two virtual text "below"
Bram Moolenaar <Bram@vim.org>
parents:
30765
diff
changeset
|
662 int col_off = win_col_off(wp) - win_col_off2(wp); |
30365
748b8dcfba57
patch 9.0.0518: virtual text highlight starts too early with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
30361
diff
changeset
|
663 |
30205
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
664 if (above) |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
665 { |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
666 before = 0; |
30213
4fedacdad3b4
patch 9.0.0442: virtual text "above" doesn't handel line numbers
Bram Moolenaar <Bram@vim.org>
parents:
30205
diff
changeset
|
667 after = wp->w_width - cells - win_col_off(wp) - padding; |
30205
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
668 } |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
669 else |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
670 { |
30205
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
671 // Right-align: fill with before |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
672 if (right) |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
673 before -= cells; |
31257
6ebd92646276
patch 9.0.0962: virtual text below cannot be placed below empty lines
Bram Moolenaar <Bram@vim.org>
parents:
31223
diff
changeset
|
674 |
6ebd92646276
patch 9.0.0962: virtual text below cannot be placed below empty lines
Bram Moolenaar <Bram@vim.org>
parents:
31223
diff
changeset
|
675 // Below-align: empty line add one character |
31283
0db9f6400e71
patch 9.0.0975: virtual text below empty line misplaced when 'number' set
Bram Moolenaar <Bram@vim.org>
parents:
31257
diff
changeset
|
676 if (below && vcol == 0 && col_with_padding == col_off |
0db9f6400e71
patch 9.0.0975: virtual text below empty line misplaced when 'number' set
Bram Moolenaar <Bram@vim.org>
parents:
31257
diff
changeset
|
677 && wp->w_width - col_off == before) |
0db9f6400e71
patch 9.0.0975: virtual text below empty line misplaced when 'number' set
Bram Moolenaar <Bram@vim.org>
parents:
31257
diff
changeset
|
678 col_with_padding += 1; |
31257
6ebd92646276
patch 9.0.0962: virtual text below cannot be placed below empty lines
Bram Moolenaar <Bram@vim.org>
parents:
31223
diff
changeset
|
679 |
30205
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
680 if (before < 0 |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
681 || !(right || below) |
31257
6ebd92646276
patch 9.0.0962: virtual text below cannot be placed below empty lines
Bram Moolenaar <Bram@vim.org>
parents:
31223
diff
changeset
|
682 || (below ? (col_with_padding <= col_off || !wp->w_p_wrap) |
6ebd92646276
patch 9.0.0962: virtual text below cannot be placed below empty lines
Bram Moolenaar <Bram@vim.org>
parents:
31223
diff
changeset
|
683 : (n_used < *n_extra))) |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
684 { |
30781
82fd47d71971
patch 9.0.0725: virtual text "after" wraps to next line when 'wrap' is off
Bram Moolenaar <Bram@vim.org>
parents:
30777
diff
changeset
|
685 if (right && (wrap |
82fd47d71971
patch 9.0.0725: virtual text "after" wraps to next line when 'wrap' is off
Bram Moolenaar <Bram@vim.org>
parents:
30777
diff
changeset
|
686 || (room < PROP_TEXT_MIN_CELLS && wp->w_p_wrap))) |
30205
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
687 { |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
688 // right-align on next line instead of wrapping if possible |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
689 before = wp->w_width - col_off - strsize + room; |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
690 if (before < 0) |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
691 before = 0; |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
692 else |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
693 n_used = *n_extra; |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
694 } |
31371
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
695 else if (below && before > vcol && do_skip) |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
696 before -= vcol; |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
697 else |
30205
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
698 before = 0; |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
699 } |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
700 } |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
701 |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
702 // With 'nowrap' add one to show the "extends" character if needed (it |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
703 // doesn't show if the text just fits). |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
704 if (!wp->w_p_wrap |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
705 && n_used < *n_extra |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
706 && wp->w_lcs_chars.ext != NUL |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
707 && wp->w_p_list) |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
708 ++n_used; |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
709 |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
710 // add 1 for NUL, 2 for when '…' is used |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
711 if (n_attr != NULL) |
30205
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
712 l = alloc(n_used + before + after + padding + 3); |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
713 if (n_attr == NULL || l != NULL) |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
714 { |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
715 int off = 0; |
29560
14b139cbec49
patch 9.0.0121: cannot put virtual text after or below a line
Bram Moolenaar <Bram@vim.org>
parents:
29550
diff
changeset
|
716 |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
717 if (n_attr != NULL) |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
718 { |
30205
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
719 vim_memset(l, ' ', before); |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
720 off += before; |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
721 if (padding > 0) |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
722 { |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
723 vim_memset(l + off, ' ', padding); |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
724 off += padding; |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
725 } |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
726 vim_strncpy(l + off, *p_extra, n_used); |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
727 off += n_used; |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
728 } |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
729 else |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
730 { |
30205
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
731 off = before + after + padding + n_used; |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
732 cells += before + after + padding; |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
733 } |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
734 if (n_attr != NULL) |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
735 { |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
736 if (n_used < *n_extra && wp->w_p_wrap) |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
737 { |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
738 char_u *lp = l + off - 1; |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
739 |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
740 if (has_mbyte) |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
741 { |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
742 // change last character to '…' |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
743 lp -= (*mb_head_off)(l, lp); |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
744 STRCPY(lp, "…"); |
30741
11875afe85b2
patch 9.0.0705: virtual text truncation does not take padding into account
Bram Moolenaar <Bram@vim.org>
parents:
30713
diff
changeset
|
745 n_used = lp - l + 3 - before - padding; |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
746 } |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
747 else |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
748 // change last character to '>' |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
749 *lp = '>'; |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
750 } |
30205
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
751 else if (after > 0) |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
752 { |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
753 vim_memset(l + off, ' ', after); |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
754 l[off + after] = NUL; |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
755 } |
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
756 |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
757 *p_extra = l; |
30205
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
758 *n_extra = n_used + before + after + padding; |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
759 *n_attr = mb_charlen(*p_extra); |
30213
4fedacdad3b4
patch 9.0.0442: virtual text "above" doesn't handel line numbers
Bram Moolenaar <Bram@vim.org>
parents:
30205
diff
changeset
|
760 if (above) |
30361
d03040b399de
patch 9.0.0516: virtual text "above" highlights gap after it
Bram Moolenaar <Bram@vim.org>
parents:
30359
diff
changeset
|
761 *n_attr -= padding + after; |
30759
b41ccaa6fd84
patch 9.0.0714: with 'nowrap' two virtual text below not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
30749
diff
changeset
|
762 |
31323
a93392e93a53
patch 9.0.0995: padding before virtual text is highlighted
Bram Moolenaar <Bram@vim.org>
parents:
31315
diff
changeset
|
763 // n_attr_skip will not be decremented before draw_state is |
a93392e93a53
patch 9.0.0995: padding before virtual text is highlighted
Bram Moolenaar <Bram@vim.org>
parents:
31315
diff
changeset
|
764 // WL_LINE |
a93392e93a53
patch 9.0.0995: padding before virtual text is highlighted
Bram Moolenaar <Bram@vim.org>
parents:
31315
diff
changeset
|
765 *n_attr_skip = before + padding; |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
766 } |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
767 } |
29560
14b139cbec49
patch 9.0.0121: cannot put virtual text after or below a line
Bram Moolenaar <Bram@vim.org>
parents:
29550
diff
changeset
|
768 } |
29690
1a9b3c96ed08
patch 9.0.0185: virtual text does not show if text prop at same position
Bram Moolenaar <Bram@vim.org>
parents:
29688
diff
changeset
|
769 |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
770 if (n_attr == NULL) |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
771 return cells; |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
772 return (below && col_with_padding > win_col_off(wp) && !wp->w_p_wrap); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
773 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
774 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
775 |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
776 /* |
30628
2d7905da4e82
patch 9.0.0649: no indication the first line is broken for 'smoothscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30614
diff
changeset
|
777 * Call screen_line() using values from "wlv". |
30693
a59a8ce13129
patch 9.0.0681: "<<<" shows for 'smoothscroll' even when 'showbreak is set
Bram Moolenaar <Bram@vim.org>
parents:
30691
diff
changeset
|
778 * Also takes care of putting "<<<" on the first line for 'smoothscroll' |
a59a8ce13129
patch 9.0.0681: "<<<" shows for 'smoothscroll' even when 'showbreak is set
Bram Moolenaar <Bram@vim.org>
parents:
30691
diff
changeset
|
779 * when 'showbreak' is not set. |
30628
2d7905da4e82
patch 9.0.0649: no indication the first line is broken for 'smoothscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30614
diff
changeset
|
780 */ |
2d7905da4e82
patch 9.0.0649: no indication the first line is broken for 'smoothscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30614
diff
changeset
|
781 static void |
2d7905da4e82
patch 9.0.0649: no indication the first line is broken for 'smoothscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30614
diff
changeset
|
782 wlv_screen_line(win_T *wp, winlinevars_T *wlv, int negative_width) |
2d7905da4e82
patch 9.0.0649: no indication the first line is broken for 'smoothscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30614
diff
changeset
|
783 { |
30693
a59a8ce13129
patch 9.0.0681: "<<<" shows for 'smoothscroll' even when 'showbreak is set
Bram Moolenaar <Bram@vim.org>
parents:
30691
diff
changeset
|
784 if (wlv->row == 0 && wp->w_skipcol > 0 |
a59a8ce13129
patch 9.0.0681: "<<<" shows for 'smoothscroll' even when 'showbreak is set
Bram Moolenaar <Bram@vim.org>
parents:
30691
diff
changeset
|
785 #if defined(FEAT_LINEBREAK) |
30847
2c03ff81cbcb
patch 9.0.0758: "precedes" from 'listchars' overwritten by <<<
Bram Moolenaar <Bram@vim.org>
parents:
30845
diff
changeset
|
786 // do not overwrite the 'showbreak' text with "<<<" |
30693
a59a8ce13129
patch 9.0.0681: "<<<" shows for 'smoothscroll' even when 'showbreak is set
Bram Moolenaar <Bram@vim.org>
parents:
30691
diff
changeset
|
787 && *get_showbreak_value(wp) == NUL |
a59a8ce13129
patch 9.0.0681: "<<<" shows for 'smoothscroll' even when 'showbreak is set
Bram Moolenaar <Bram@vim.org>
parents:
30691
diff
changeset
|
788 #endif |
30847
2c03ff81cbcb
patch 9.0.0758: "precedes" from 'listchars' overwritten by <<<
Bram Moolenaar <Bram@vim.org>
parents:
30845
diff
changeset
|
789 // do not overwrite the 'listchars' "precedes" text with "<<<" |
2c03ff81cbcb
patch 9.0.0758: "precedes" from 'listchars' overwritten by <<<
Bram Moolenaar <Bram@vim.org>
parents:
30845
diff
changeset
|
790 && !(wp->w_p_list && wp->w_lcs_chars.prec != 0)) |
30628
2d7905da4e82
patch 9.0.0649: no indication the first line is broken for 'smoothscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30614
diff
changeset
|
791 { |
2d7905da4e82
patch 9.0.0649: no indication the first line is broken for 'smoothscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30614
diff
changeset
|
792 int off = (int)(current_ScreenLine - ScreenLines); |
30845
fa3aba805a34
patch 9.0.0757: line number not visisble with 'smoothscroll', 'nu' and 'rnu'
Bram Moolenaar <Bram@vim.org>
parents:
30825
diff
changeset
|
793 int skip = 0; |
30628
2d7905da4e82
patch 9.0.0649: no indication the first line is broken for 'smoothscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30614
diff
changeset
|
794 |
30845
fa3aba805a34
patch 9.0.0757: line number not visisble with 'smoothscroll', 'nu' and 'rnu'
Bram Moolenaar <Bram@vim.org>
parents:
30825
diff
changeset
|
795 if (wp->w_p_nu && wp->w_p_rnu) |
fa3aba805a34
patch 9.0.0757: line number not visisble with 'smoothscroll', 'nu' and 'rnu'
Bram Moolenaar <Bram@vim.org>
parents:
30825
diff
changeset
|
796 // Do not overwrite the line number, change "123 text" to |
fa3aba805a34
patch 9.0.0757: line number not visisble with 'smoothscroll', 'nu' and 'rnu'
Bram Moolenaar <Bram@vim.org>
parents:
30825
diff
changeset
|
797 // "123>>>xt". |
fa3aba805a34
patch 9.0.0757: line number not visisble with 'smoothscroll', 'nu' and 'rnu'
Bram Moolenaar <Bram@vim.org>
parents:
30825
diff
changeset
|
798 while (skip < wp->w_width && VIM_ISDIGIT(ScreenLines[off])) |
fa3aba805a34
patch 9.0.0757: line number not visisble with 'smoothscroll', 'nu' and 'rnu'
Bram Moolenaar <Bram@vim.org>
parents:
30825
diff
changeset
|
799 { |
fa3aba805a34
patch 9.0.0757: line number not visisble with 'smoothscroll', 'nu' and 'rnu'
Bram Moolenaar <Bram@vim.org>
parents:
30825
diff
changeset
|
800 ++off; |
fa3aba805a34
patch 9.0.0757: line number not visisble with 'smoothscroll', 'nu' and 'rnu'
Bram Moolenaar <Bram@vim.org>
parents:
30825
diff
changeset
|
801 ++skip; |
fa3aba805a34
patch 9.0.0757: line number not visisble with 'smoothscroll', 'nu' and 'rnu'
Bram Moolenaar <Bram@vim.org>
parents:
30825
diff
changeset
|
802 } |
fa3aba805a34
patch 9.0.0757: line number not visisble with 'smoothscroll', 'nu' and 'rnu'
Bram Moolenaar <Bram@vim.org>
parents:
30825
diff
changeset
|
803 |
fa3aba805a34
patch 9.0.0757: line number not visisble with 'smoothscroll', 'nu' and 'rnu'
Bram Moolenaar <Bram@vim.org>
parents:
30825
diff
changeset
|
804 for (int i = 0; i < 3 && i + skip < wp->w_width; ++i) |
30628
2d7905da4e82
patch 9.0.0649: no indication the first line is broken for 'smoothscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30614
diff
changeset
|
805 { |
2d7905da4e82
patch 9.0.0649: no indication the first line is broken for 'smoothscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30614
diff
changeset
|
806 ScreenLines[off] = '<'; |
2d7905da4e82
patch 9.0.0649: no indication the first line is broken for 'smoothscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30614
diff
changeset
|
807 if (enc_utf8) |
2d7905da4e82
patch 9.0.0649: no indication the first line is broken for 'smoothscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30614
diff
changeset
|
808 ScreenLinesUC[off] = 0; |
2d7905da4e82
patch 9.0.0649: no indication the first line is broken for 'smoothscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30614
diff
changeset
|
809 ScreenAttrs[off] = HL_ATTR(HLF_AT); |
2d7905da4e82
patch 9.0.0649: no indication the first line is broken for 'smoothscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30614
diff
changeset
|
810 ++off; |
2d7905da4e82
patch 9.0.0649: no indication the first line is broken for 'smoothscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30614
diff
changeset
|
811 } |
2d7905da4e82
patch 9.0.0649: no indication the first line is broken for 'smoothscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30614
diff
changeset
|
812 } |
2d7905da4e82
patch 9.0.0649: no indication the first line is broken for 'smoothscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30614
diff
changeset
|
813 |
2d7905da4e82
patch 9.0.0649: no indication the first line is broken for 'smoothscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30614
diff
changeset
|
814 screen_line(wp, wlv->screen_row, wp->w_wincol, wlv->col, |
2d7905da4e82
patch 9.0.0649: no indication the first line is broken for 'smoothscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30614
diff
changeset
|
815 negative_width ? -wp->w_width : wp->w_width, |
2d7905da4e82
patch 9.0.0649: no indication the first line is broken for 'smoothscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30614
diff
changeset
|
816 wlv->screen_line_flags); |
2d7905da4e82
patch 9.0.0649: no indication the first line is broken for 'smoothscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30614
diff
changeset
|
817 } |
2d7905da4e82
patch 9.0.0649: no indication the first line is broken for 'smoothscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30614
diff
changeset
|
818 |
2d7905da4e82
patch 9.0.0649: no indication the first line is broken for 'smoothscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30614
diff
changeset
|
819 /* |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
820 * Called when finished with the line: draw the screen line and handle any |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
821 * highlighting until the right of the window. |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
822 */ |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
823 static void |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
824 draw_screen_line(win_T *wp, winlinevars_T *wlv) |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
825 { |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
826 #ifdef FEAT_SYN_HL |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
827 long v; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
828 |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
829 // Highlight 'cursorcolumn' & 'colorcolumn' past end of the line. |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
830 if (wp->w_p_wrap) |
30610
6c6ac189a05f
patch 9.0.0640: cannot scroll by screen line if a line wraps
Bram Moolenaar <Bram@vim.org>
parents:
30509
diff
changeset
|
831 v = wlv->startrow == 0 ? wp->w_skipcol : 0; |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
832 else |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
833 v = wp->w_leftcol; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
834 |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
835 // check if line ends before left margin |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
836 if (wlv->vcol < v + wlv->col - win_col_off(wp)) |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
837 wlv->vcol = v + wlv->col - win_col_off(wp); |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
838 # ifdef FEAT_CONCEAL |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
839 // Get rid of the boguscols now, we want to draw until the right |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
840 // edge for 'cursorcolumn'. |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
841 wlv->col -= wlv->boguscols; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
842 wlv->boguscols = 0; |
31986
e0e1ba7daaf4
patch 9.0.1325: 'colorcolumn' highlight wrong with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31944
diff
changeset
|
843 # define VCOL_HLC (wlv->vcol - wlv->vcol_off_co - wlv->vcol_off_tp) |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
844 # else |
31986
e0e1ba7daaf4
patch 9.0.1325: 'colorcolumn' highlight wrong with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31944
diff
changeset
|
845 # define VCOL_HLC (wlv->vcol - wlv->vcol_off_tp) |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
846 # endif |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
847 |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
848 if (wlv->draw_color_col) |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
849 wlv->draw_color_col = advance_color_col(VCOL_HLC, &wlv->color_cols); |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
850 |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
851 if (((wp->w_p_cuc |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
852 && (int)wp->w_virtcol >= VCOL_HLC - wlv->eol_hl_off |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
853 && (int)wp->w_virtcol < |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
854 (long)wp->w_width * (wlv->row - wlv->startrow + 1) + v |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
855 && wlv->lnum != wp->w_cursor.lnum) |
31297
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
856 || wlv->draw_color_col |
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
857 # ifdef LINE_ATTR |
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
858 || wlv->line_attr != 0 |
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
859 # endif |
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
860 || wlv->win_attr != 0) |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
861 # ifdef FEAT_RIGHTLEFT |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
862 && !wp->w_p_rl |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
863 # endif |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
864 ) |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
865 { |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
866 int rightmost_vcol = 0; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
867 int i; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
868 |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
869 if (wp->w_p_cuc) |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
870 rightmost_vcol = wp->w_virtcol; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
871 if (wlv->draw_color_col) |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
872 // determine rightmost colorcolumn to possibly draw |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
873 for (i = 0; wlv->color_cols[i] >= 0; ++i) |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
874 if (rightmost_vcol < wlv->color_cols[i]) |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
875 rightmost_vcol = wlv->color_cols[i]; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
876 |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
877 while (wlv->col < wp->w_width) |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
878 { |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
879 ScreenLines[wlv->off] = ' '; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
880 if (enc_utf8) |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
881 ScreenLinesUC[wlv->off] = 0; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
882 ScreenCols[wlv->off] = MAXCOL; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
883 ++wlv->col; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
884 if (wlv->draw_color_col) |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
885 wlv->draw_color_col = advance_color_col( |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
886 VCOL_HLC, &wlv->color_cols); |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
887 |
31297
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
888 int attr = wlv->win_attr; |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
889 if (wp->w_p_cuc && VCOL_HLC == (long)wp->w_virtcol) |
31297
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
890 attr = HL_ATTR(HLF_CUC); |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
891 else if (wlv->draw_color_col && VCOL_HLC == *wlv->color_cols) |
31297
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
892 attr = HL_ATTR(HLF_MC); |
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
893 # ifdef LINE_ATTR |
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
894 else if (wlv->line_attr != 0) |
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
895 attr = wlv->line_attr; |
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
896 # endif |
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
897 ScreenAttrs[wlv->off++] = attr; |
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
898 |
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
899 if (VCOL_HLC >= rightmost_vcol |
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
900 # ifdef LINE_ATTR |
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
901 && wlv->line_attr == 0 |
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
902 # endif |
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
903 && wlv->win_attr == 0) |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
904 break; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
905 |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
906 ++wlv->vcol; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
907 } |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
908 } |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
909 #endif |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
910 |
30628
2d7905da4e82
patch 9.0.0649: no indication the first line is broken for 'smoothscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30614
diff
changeset
|
911 wlv_screen_line(wp, wlv, FALSE); |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
912 ++wlv->row; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
913 ++wlv->screen_row; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
914 } |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
915 #undef VCOL_HLC |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
916 |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
917 /* |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
918 * Start a screen line at column zero. |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
919 * When "save_extra" is TRUE save and reset n_extra, p_extra, etc. |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
920 */ |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
921 static void |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
922 win_line_start(win_T *wp UNUSED, winlinevars_T *wlv, int save_extra) |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
923 { |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
924 wlv->col = 0; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
925 wlv->off = (unsigned)(current_ScreenLine - ScreenLines); |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
926 |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
927 #ifdef FEAT_RIGHTLEFT |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
928 if (wp->w_p_rl) |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
929 { |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
930 // Rightleft window: process the text in the normal direction, but put |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
931 // it in current_ScreenLine[] from right to left. Start at the |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
932 // rightmost column of the window. |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
933 wlv->col = wp->w_width - 1; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
934 wlv->off += wlv->col; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
935 wlv->screen_line_flags |= SLF_RIGHTLEFT; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
936 } |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
937 #endif |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
938 if (save_extra) |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
939 { |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
940 // reset the drawing state for the start of a wrapped line |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
941 wlv->draw_state = WL_START; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
942 wlv->saved_n_extra = wlv->n_extra; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
943 wlv->saved_p_extra = wlv->p_extra; |
31113
6ff733178f8b
patch 9.0.0891: virtual text below after match has wrong highlight
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
944 wlv->saved_extra_attr = wlv->extra_attr; |
31323
a93392e93a53
patch 9.0.0995: padding before virtual text is highlighted
Bram Moolenaar <Bram@vim.org>
parents:
31315
diff
changeset
|
945 wlv->saved_n_attr_skip = wlv->n_attr_skip; |
31113
6ff733178f8b
patch 9.0.0891: virtual text below after match has wrong highlight
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
946 wlv->saved_extra_for_textprop = wlv->extra_for_textprop; |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
947 wlv->saved_c_extra = wlv->c_extra; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
948 wlv->saved_c_final = wlv->c_final; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
949 #ifdef FEAT_SYN_HL |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
950 if (!(wlv->cul_screenline |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
951 # ifdef FEAT_DIFF |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
952 && wlv->diff_hlf == (hlf_T)0 |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
953 # endif |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
954 )) |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
955 wlv->saved_char_attr = wlv->char_attr; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
956 else |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
957 #endif |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
958 wlv->saved_char_attr = 0; |
31323
a93392e93a53
patch 9.0.0995: padding before virtual text is highlighted
Bram Moolenaar <Bram@vim.org>
parents:
31315
diff
changeset
|
959 |
a93392e93a53
patch 9.0.0995: padding before virtual text is highlighted
Bram Moolenaar <Bram@vim.org>
parents:
31315
diff
changeset
|
960 // these are not used until restored in win_line_continue() |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
961 wlv->n_extra = 0; |
31323
a93392e93a53
patch 9.0.0995: padding before virtual text is highlighted
Bram Moolenaar <Bram@vim.org>
parents:
31315
diff
changeset
|
962 wlv->n_attr_skip = 0; |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
963 } |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
964 } |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
965 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
966 /* |
30395
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
967 * Called when wlv->draw_state is set to WL_LINE. |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
968 */ |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
969 static void |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
970 win_line_continue(winlinevars_T *wlv) |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
971 { |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
972 if (wlv->saved_n_extra > 0) |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
973 { |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
974 // Continue item from end of wrapped line. |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
975 wlv->n_extra = wlv->saved_n_extra; |
31221
59de2172e99d
patch 9.0.0944: 'cursorline' causes virtual text highlight to continue
Bram Moolenaar <Bram@vim.org>
parents:
31142
diff
changeset
|
976 wlv->saved_n_extra = 0; |
30395
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
977 wlv->c_extra = wlv->saved_c_extra; |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
978 wlv->c_final = wlv->saved_c_final; |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
979 wlv->p_extra = wlv->saved_p_extra; |
31113
6ff733178f8b
patch 9.0.0891: virtual text below after match has wrong highlight
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
980 wlv->extra_attr = wlv->saved_extra_attr; |
31323
a93392e93a53
patch 9.0.0995: padding before virtual text is highlighted
Bram Moolenaar <Bram@vim.org>
parents:
31315
diff
changeset
|
981 wlv->n_attr_skip = wlv->saved_n_attr_skip; |
31113
6ff733178f8b
patch 9.0.0891: virtual text below after match has wrong highlight
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
982 wlv->extra_for_textprop = wlv->saved_extra_for_textprop; |
30395
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
983 wlv->char_attr = wlv->saved_char_attr; |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
984 } |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
985 else |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
986 wlv->char_attr = wlv->win_attr; |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
987 } |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
988 |
31431
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
989 #ifdef FEAT_SYN_HL |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
990 static void |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
991 apply_cursorline_highlight( |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
992 winlinevars_T *wlv, |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
993 int sign_present UNUSED) |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
994 { |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
995 wlv->cul_attr = HL_ATTR(HLF_CUL); |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
996 # ifdef FEAT_SIGNS |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
997 // Combine the 'cursorline' and sign highlighting, depending on |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
998 // the sign priority. |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
999 if (sign_present && wlv->sattr.sat_linehl > 0) |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
1000 { |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
1001 if (wlv->sattr.sat_priority >= 100) |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
1002 wlv->line_attr = hl_combine_attr(wlv->cul_attr, wlv->line_attr); |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
1003 else |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
1004 wlv->line_attr = hl_combine_attr(wlv->line_attr, wlv->cul_attr); |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
1005 } |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
1006 else |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
1007 # endif |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
1008 # if defined(FEAT_QUICKFIX) |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
1009 // let the line attribute overrule 'cursorline', otherwise |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
1010 // it disappears when both have background set; |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
1011 // 'cursorline' can use underline or bold to make it show |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
1012 wlv->line_attr = hl_combine_attr(wlv->cul_attr, wlv->line_attr); |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
1013 # else |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
1014 wlv->line_attr = wlv->cul_attr; |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
1015 # endif |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
1016 } |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
1017 #endif |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
1018 |
30395
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
1019 /* |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1020 * Display line "lnum" of window 'wp' on the screen. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1021 * Start at row "startrow", stop when "endrow" is reached. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1022 * wp->w_virtcol needs to be valid. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1023 * |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1024 * Return the number of last row the line occupies. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1025 */ |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1026 int |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1027 win_line( |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1028 win_T *wp, |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1029 linenr_T lnum, |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1030 int startrow, |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1031 int endrow, |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1032 int nochange UNUSED, // not updating for changed text |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1033 int number_only) // only update the number column |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1034 { |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1035 winlinevars_T wlv; // variables passed between functions |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1036 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1037 int c = 0; // init for GCC |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1038 long vcol_prev = -1; // "wlv.vcol" of previous character |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1039 char_u *line; // current line |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1040 char_u *ptr; // current position in "line" |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1041 |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1042 #ifdef FEAT_PROP_POPUP |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1043 char_u *p_extra_free2 = NULL; // another p_extra to be freed |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1044 #endif |
26374
59f2b11ad1be
patch 8.2.3718: compiler warns for unused variable without +textprop
Bram Moolenaar <Bram@vim.org>
parents:
26350
diff
changeset
|
1045 #if defined(FEAT_LINEBREAK) && defined(FEAT_PROP_POPUP) |
26338
4cf208415483
patch 8.2.3700: text property highlighting continues over breakindent
Bram Moolenaar <Bram@vim.org>
parents:
26334
diff
changeset
|
1046 int in_linebreak = FALSE; // n_extra set for showing linebreak |
4cf208415483
patch 8.2.3700: text property highlighting continues over breakindent
Bram Moolenaar <Bram@vim.org>
parents:
26334
diff
changeset
|
1047 #endif |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1048 static char_u *at_end_str = (char_u *)""; // used for p_extra when |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23901
diff
changeset
|
1049 // displaying eol at end-of-line |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23901
diff
changeset
|
1050 int lcs_eol_one = wp->w_lcs_chars.eol; // eol until it's been used |
26374
59f2b11ad1be
patch 8.2.3718: compiler warns for unused variable without +textprop
Bram Moolenaar <Bram@vim.org>
parents:
26350
diff
changeset
|
1051 int lcs_prec_todo = wp->w_lcs_chars.prec; |
59f2b11ad1be
patch 8.2.3718: compiler warns for unused variable without +textprop
Bram Moolenaar <Bram@vim.org>
parents:
26350
diff
changeset
|
1052 // prec until it's been used |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1053 |
29560
14b139cbec49
patch 9.0.0121: cannot put virtual text after or below a line
Bram Moolenaar <Bram@vim.org>
parents:
29550
diff
changeset
|
1054 int n_attr = 0; // chars with special attr |
14b139cbec49
patch 9.0.0121: cannot put virtual text after or below a line
Bram Moolenaar <Bram@vim.org>
parents:
29550
diff
changeset
|
1055 int saved_attr2 = 0; // char_attr saved for n_attr |
14b139cbec49
patch 9.0.0121: cannot put virtual text after or below a line
Bram Moolenaar <Bram@vim.org>
parents:
29550
diff
changeset
|
1056 int n_attr3 = 0; // chars with overruling special attr |
14b139cbec49
patch 9.0.0121: cannot put virtual text after or below a line
Bram Moolenaar <Bram@vim.org>
parents:
29550
diff
changeset
|
1057 int saved_attr3 = 0; // char_attr saved for n_attr3 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1058 |
30763
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
1059 int n_skip = 0; // nr of cells to skip for 'nowrap' or |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
1060 // concealing |
30765
3002177fa0b1
patch 9.0.0717: compiler warning for unused variable in tiny build
Bram Moolenaar <Bram@vim.org>
parents:
30763
diff
changeset
|
1061 #ifdef FEAT_PROP_POPUP |
30763
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
1062 int skip_cells = 0; // nr of cells to skip for virtual text |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
1063 // after the line, when w_skipcol is |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
1064 // larger than the text length |
30765
3002177fa0b1
patch 9.0.0717: compiler warning for unused variable in tiny build
Bram Moolenaar <Bram@vim.org>
parents:
30763
diff
changeset
|
1065 #endif |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1066 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1067 int fromcol_prev = -2; // start of inverting after cursor |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1068 int noinvcur = FALSE; // don't invert the cursor |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1069 int lnum_in_visual_area = FALSE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1070 pos_T pos; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1071 long v; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1072 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1073 int attr_pri = FALSE; // char_attr has priority |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1074 int area_highlighting = FALSE; // Visual or incsearch highlighting |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1075 // in this line |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1076 int vi_attr = 0; // attributes for Visual and incsearch |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1077 // highlighting |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1078 int area_attr = 0; // attributes desired by highlighting |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1079 int search_attr = 0; // attributes desired by 'hlsearch' |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1080 #ifdef FEAT_SYN_HL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1081 int vcol_save_attr = 0; // saved attr for 'cursorcolumn' |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1082 int syntax_attr = 0; // attributes desired by syntax |
18323
72a0dbe1c004
patch 8.1.2156: first character after Tab is not highlighted
Bram Moolenaar <Bram@vim.org>
parents:
18321
diff
changeset
|
1083 int prev_syntax_col = -1; // column of prev_syntax_attr |
72a0dbe1c004
patch 8.1.2156: first character after Tab is not highlighted
Bram Moolenaar <Bram@vim.org>
parents:
18321
diff
changeset
|
1084 int prev_syntax_attr = 0; // syntax_attr at prev_syntax_col |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1085 int has_syntax = FALSE; // this buffer has syntax highl. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1086 int save_did_emsg; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1087 #endif |
18763
49b78d6465e5
patch 8.1.2371: FEAT_TEXT_PROP is a confusing name
Bram Moolenaar <Bram@vim.org>
parents:
18720
diff
changeset
|
1088 #ifdef FEAT_PROP_POPUP |
31938
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
1089 int did_line = FALSE; // set to TRUE when line text done |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1090 int text_prop_count; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1091 int text_prop_next = 0; // next text property to use |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1092 textprop_T *text_props = NULL; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1093 int *text_prop_idxs = NULL; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1094 int text_props_active = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1095 proptype_T *text_prop_type = NULL; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1096 int text_prop_attr = 0; |
30039
4b9b237d1211
patch 9.0.0357: 'linebreak' interferes with text property highlight
Bram Moolenaar <Bram@vim.org>
parents:
29918
diff
changeset
|
1097 int text_prop_attr_comb = 0; // text_prop_attr combined with |
4b9b237d1211
patch 9.0.0357: 'linebreak' interferes with text property highlight
Bram Moolenaar <Bram@vim.org>
parents:
29918
diff
changeset
|
1098 // syntax_attr |
29451
057c26b5c33a
patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29413
diff
changeset
|
1099 int text_prop_id = 0; // active property ID |
29611
608d5221a3e5
patch 9.0.0146: missing part of change for "override" flag
Bram Moolenaar <Bram@vim.org>
parents:
29597
diff
changeset
|
1100 int text_prop_flags = 0; |
30231
0d084880276a
patch 9.0.0451: virtual text "above" does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
30213
diff
changeset
|
1101 int text_prop_above = FALSE; // first doing virtual text above |
29560
14b139cbec49
patch 9.0.0121: cannot put virtual text after or below a line
Bram Moolenaar <Bram@vim.org>
parents:
29550
diff
changeset
|
1102 int text_prop_follows = FALSE; // another text prop to display |
29706
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
1103 int saved_search_attr = 0; // search_attr to be used when n_extra |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
1104 // goes to zero |
30233
8d660a45299f
patch 9.0.0452: Visual highlighting extends into virtual text prop
Bram Moolenaar <Bram@vim.org>
parents:
30231
diff
changeset
|
1105 int saved_area_attr = 0; // idem for area_attr |
31221
59de2172e99d
patch 9.0.0944: 'cursorline' causes virtual text highlight to continue
Bram Moolenaar <Bram@vim.org>
parents:
31142
diff
changeset
|
1106 int reset_extra_attr = FALSE; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1107 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1108 #ifdef FEAT_SPELL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1109 int has_spell = FALSE; // this buffer has spell checking |
27889
ec6756baed23
patch 8.2.4470: Coverity warns for uninitialized variable
Bram Moolenaar <Bram@vim.org>
parents:
27752
diff
changeset
|
1110 int can_spell = FALSE; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1111 # define SPWORDLEN 150 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1112 char_u nextline[SPWORDLEN * 2];// text with start of the next line |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1113 int nextlinecol = 0; // column where nextline[] starts |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1114 int nextline_idx = 0; // index in nextline[] where next line |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1115 // starts |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1116 int spell_attr = 0; // attributes desired by spelling |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1117 int word_end = 0; // last byte with same spell_attr |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1118 static linenr_T checked_lnum = 0; // line number for "checked_col" |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1119 static int checked_col = 0; // column in "checked_lnum" up to which |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1120 // there are no spell errors |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1121 static int cap_col = -1; // column to check for Cap word |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1122 static linenr_T capcol_lnum = 0; // line number where "cap_col" used |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1123 int cur_checked_col = 0; // checked column for current line |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1124 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1125 int extra_check = 0; // has extra highlighting |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1126 int multi_attr = 0; // attributes desired by multibyte |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1127 int mb_l = 1; // multi-byte byte length |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1128 int mb_c = 0; // decoded multi-byte character |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1129 int mb_utf8 = FALSE; // screen char is UTF-8 char |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1130 int u8cc[MAX_MCO]; // composing UTF-8 chars |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1131 #ifdef FEAT_DIFF |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1132 int change_start = MAXCOL; // first col of changed area |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1133 int change_end = -1; // last col of changed area |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1134 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1135 colnr_T trailcol = MAXCOL; // start of trailing spaces |
23825
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
22997
diff
changeset
|
1136 colnr_T leadcol = 0; // start of leading spaces |
25778
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25749
diff
changeset
|
1137 int in_multispace = FALSE; // in multiple consecutive spaces |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25749
diff
changeset
|
1138 int multispace_pos = 0; // position in lcs-multispace string |
31297
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
1139 #ifdef LINE_ATTR |
29641
b2cf1634c782
patch 9.0.0161: warning for uninitialized variable
Bram Moolenaar <Bram@vim.org>
parents:
29639
diff
changeset
|
1140 int line_attr_save = 0; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1141 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1142 int sign_present = FALSE; |
26690
84d60deb8f82
patch 8.2.3874: cannot highlight the number column for a sign
Bram Moolenaar <Bram@vim.org>
parents:
26384
diff
changeset
|
1143 int num_attr = 0; // attribute for the number column |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1144 #ifdef FEAT_ARABIC |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1145 int prev_c = 0; // previous Arabic character |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1146 int prev_c1 = 0; // first composing char for prev_c |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1147 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1148 #if defined(LINE_ATTR) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1149 int did_line_attr = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1150 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1151 #ifdef FEAT_TERMINAL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1152 int get_term_attr = FALSE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1153 #endif |
30395
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
1154 |
30825
c7983f593fa7
patch 9.0.0747: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
30781
diff
changeset
|
1155 #if defined(FEAT_SYN_HL) || defined(FEAT_DIFF) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1156 // margin columns for the screen line, needed for when 'cursorlineopt' |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1157 // contains "screenline" |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1158 int left_curline_col = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1159 int right_curline_col = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1160 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1161 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1162 #if defined(FEAT_XIM) && defined(FEAT_GUI_GTK) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1163 int feedback_col = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1164 int feedback_old_attr = -1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1165 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1166 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1167 #if defined(FEAT_CONCEAL) || defined(FEAT_SEARCH_EXTRA) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1168 int match_conc = 0; // cchar for match functions |
30825
c7983f593fa7
patch 9.0.0747: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
30781
diff
changeset
|
1169 #endif |
c7983f593fa7
patch 9.0.0747: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
30781
diff
changeset
|
1170 #if defined(FEAT_CONCEAL) || defined(FEAT_SEARCH_EXTRA) || defined(FEAT_LINEBREAK) |
26334
baec4e1cee43
patch 8.2.3698: match highlighting continues over breakindent
Bram Moolenaar <Bram@vim.org>
parents:
26266
diff
changeset
|
1171 int on_last_col = FALSE; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1172 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1173 #ifdef FEAT_CONCEAL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1174 int syntax_flags = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1175 int syntax_seqnr = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1176 int prev_syntax_id = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1177 int conceal_attr = HL_ATTR(HLF_CONCEAL); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1178 int is_concealing = FALSE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1179 int did_wcol = FALSE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1180 int old_boguscols = 0; |
31986
e0e1ba7daaf4
patch 9.0.1325: 'colorcolumn' highlight wrong with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31944
diff
changeset
|
1181 # define VCOL_HLC (wlv.vcol - wlv.vcol_off_co - wlv.vcol_off_tp) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1182 # define FIX_FOR_BOGUSCOLS \ |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1183 { \ |
31986
e0e1ba7daaf4
patch 9.0.1325: 'colorcolumn' highlight wrong with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31944
diff
changeset
|
1184 wlv.n_extra += wlv.vcol_off_co; \ |
e0e1ba7daaf4
patch 9.0.1325: 'colorcolumn' highlight wrong with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31944
diff
changeset
|
1185 wlv.vcol -= wlv.vcol_off_co; \ |
e0e1ba7daaf4
patch 9.0.1325: 'colorcolumn' highlight wrong with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31944
diff
changeset
|
1186 wlv.vcol_off_co = 0; \ |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1187 wlv.col -= wlv.boguscols; \ |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1188 old_boguscols = wlv.boguscols; \ |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1189 wlv.boguscols = 0; \ |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1190 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1191 #else |
31986
e0e1ba7daaf4
patch 9.0.1325: 'colorcolumn' highlight wrong with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31944
diff
changeset
|
1192 # define VCOL_HLC (wlv.vcol - wlv.vcol_off_tp) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1193 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1194 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1195 if (startrow > endrow) // past the end already! |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1196 return startrow; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1197 |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1198 CLEAR_FIELD(wlv); |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1199 |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1200 wlv.lnum = lnum; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1201 wlv.startrow = startrow; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1202 wlv.row = startrow; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1203 wlv.screen_row = wlv.row + W_WINROW(wp); |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1204 wlv.fromcol = -10; |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1205 wlv.tocol = MAXCOL; |
30395
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
1206 #ifdef FEAT_LINEBREAK |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
1207 wlv.vcol_sbr = -1; |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
1208 #endif |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1209 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1210 if (!number_only) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1211 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1212 // To speed up the loop below, set extra_check when there is linebreak, |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1213 // trailing white space and/or syntax processing to be done. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1214 #ifdef FEAT_LINEBREAK |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1215 extra_check = wp->w_p_lbr; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1216 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1217 #ifdef FEAT_SYN_HL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1218 if (syntax_present(wp) && !wp->w_s->b_syn_error |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1219 # ifdef SYN_TIME_LIMIT |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1220 && !wp->w_s->b_syn_slow |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1221 # endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1222 ) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1223 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1224 // Prepare for syntax highlighting in this line. When there is an |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1225 // error, stop syntax highlighting. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1226 save_did_emsg = did_emsg; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1227 did_emsg = FALSE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1228 syntax_start(wp, lnum); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1229 if (did_emsg) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1230 wp->w_s->b_syn_error = TRUE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1231 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1232 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1233 did_emsg = save_did_emsg; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1234 #ifdef SYN_TIME_LIMIT |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1235 if (!wp->w_s->b_syn_slow) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1236 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1237 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1238 has_syntax = TRUE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1239 extra_check = TRUE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1240 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1241 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1242 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1243 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1244 // Check for columns to display for 'colorcolumn'. |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1245 wlv.color_cols = wp->w_p_cc_cols; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1246 if (wlv.color_cols != NULL) |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1247 wlv.draw_color_col = advance_color_col(VCOL_HLC, &wlv.color_cols); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1248 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1249 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1250 #ifdef FEAT_TERMINAL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1251 if (term_show_buffer(wp->w_buffer)) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1252 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1253 extra_check = TRUE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1254 get_term_attr = TRUE; |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1255 wlv.win_attr = term_get_attr(wp, lnum, -1); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1256 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1257 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1258 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1259 #ifdef FEAT_SPELL |
30509
087c42245022
patch 9.0.0590: after exiting Insert mode spelling not checked in next line
Bram Moolenaar <Bram@vim.org>
parents:
30397
diff
changeset
|
1260 if (spell_check_window(wp)) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1261 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1262 // Prepare for spell checking. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1263 has_spell = TRUE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1264 extra_check = TRUE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1265 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1266 // Get the start of the next line, so that words that wrap to the |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1267 // next line are found too: "et<line-break>al.". |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1268 // Trick: skip a few chars for C/shell/Vim comments |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1269 nextline[SPWORDLEN] = NUL; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1270 if (lnum < wp->w_buffer->b_ml.ml_line_count) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1271 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1272 line = ml_get_buf(wp->w_buffer, lnum + 1, FALSE); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1273 spell_cat_line(nextline + SPWORDLEN, line, SPWORDLEN); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1274 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1275 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1276 // When a word wrapped from the previous line the start of the |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1277 // current line is valid. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1278 if (lnum == checked_lnum) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1279 cur_checked_col = checked_col; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1280 checked_lnum = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1281 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1282 // When there was a sentence end in the previous line may require a |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1283 // word starting with capital in this line. In line 1 always check |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1284 // the first word. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1285 if (lnum != capcol_lnum) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1286 cap_col = -1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1287 if (lnum == 1) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1288 cap_col = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1289 capcol_lnum = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1290 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1291 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1292 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1293 // handle Visual active in this window |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1294 if (VIsual_active && wp->w_buffer == curwin->w_buffer) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1295 { |
19816
f37028184d6a
patch 8.2.0464: typos and other small problems
Bram Moolenaar <Bram@vim.org>
parents:
19503
diff
changeset
|
1296 pos_T *top, *bot; |
f37028184d6a
patch 8.2.0464: typos and other small problems
Bram Moolenaar <Bram@vim.org>
parents:
19503
diff
changeset
|
1297 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1298 if (LTOREQ_POS(curwin->w_cursor, VIsual)) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1299 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1300 // Visual is after curwin->w_cursor |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1301 top = &curwin->w_cursor; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1302 bot = &VIsual; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1303 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1304 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1305 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1306 // Visual is before curwin->w_cursor |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1307 top = &VIsual; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1308 bot = &curwin->w_cursor; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1309 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1310 lnum_in_visual_area = (lnum >= top->lnum && lnum <= bot->lnum); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1311 if (VIsual_mode == Ctrl_V) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1312 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1313 // block mode |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1314 if (lnum_in_visual_area) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1315 { |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1316 wlv.fromcol = wp->w_old_cursor_fcol; |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1317 wlv.tocol = wp->w_old_cursor_lcol; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1318 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1319 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1320 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1321 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1322 // non-block mode |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1323 if (lnum > top->lnum && lnum <= bot->lnum) |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1324 wlv.fromcol = 0; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1325 else if (lnum == top->lnum) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1326 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1327 if (VIsual_mode == 'V') // linewise |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1328 wlv.fromcol = 0; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1329 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1330 { |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1331 getvvcol(wp, top, (colnr_T *)&wlv.fromcol, NULL, NULL); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1332 if (gchar_pos(top) == NUL) |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1333 wlv.tocol = wlv.fromcol + 1; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1334 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1335 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1336 if (VIsual_mode != 'V' && lnum == bot->lnum) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1337 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1338 if (*p_sel == 'e' && bot->col == 0 && bot->coladd == 0) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1339 { |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1340 wlv.fromcol = -10; |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1341 wlv.tocol = MAXCOL; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1342 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1343 else if (bot->col == MAXCOL) |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1344 wlv.tocol = MAXCOL; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1345 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1346 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1347 pos = *bot; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1348 if (*p_sel == 'e') |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1349 getvvcol(wp, &pos, (colnr_T *)&wlv.tocol, |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1350 NULL, NULL); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1351 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1352 { |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1353 getvvcol(wp, &pos, NULL, NULL, |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1354 (colnr_T *)&wlv.tocol); |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1355 ++wlv.tocol; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1356 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1357 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1358 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1359 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1360 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1361 // Check if the character under the cursor should not be inverted |
18422
1848b3e07266
patch 8.1.2205: sign entry structure has confusing name
Bram Moolenaar <Bram@vim.org>
parents:
18390
diff
changeset
|
1362 if (!highlight_match && lnum == curwin->w_cursor.lnum |
1848b3e07266
patch 8.1.2205: sign entry structure has confusing name
Bram Moolenaar <Bram@vim.org>
parents:
18390
diff
changeset
|
1363 && wp == curwin |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1364 #ifdef FEAT_GUI |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1365 && !gui.in_use |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1366 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1367 ) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1368 noinvcur = TRUE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1369 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1370 // if inverting in this line set area_highlighting |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1371 if (wlv.fromcol >= 0) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1372 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1373 area_highlighting = TRUE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1374 vi_attr = HL_ATTR(HLF_V); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1375 #if defined(FEAT_CLIPBOARD) && defined(FEAT_X11) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1376 if ((clip_star.available && !clip_star.owned |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1377 && clip_isautosel_star()) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1378 || (clip_plus.available && !clip_plus.owned |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1379 && clip_isautosel_plus())) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1380 vi_attr = HL_ATTR(HLF_VNC); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1381 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1382 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1383 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1384 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1385 // handle 'incsearch' and ":s///c" highlighting |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1386 else if (highlight_match |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1387 && wp == curwin |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1388 && lnum >= curwin->w_cursor.lnum |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1389 && lnum <= curwin->w_cursor.lnum + search_match_lines) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1390 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1391 if (lnum == curwin->w_cursor.lnum) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1392 getvcol(curwin, &(curwin->w_cursor), |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1393 (colnr_T *)&wlv.fromcol, NULL, NULL); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1394 else |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1395 wlv.fromcol = 0; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1396 if (lnum == curwin->w_cursor.lnum + search_match_lines) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1397 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1398 pos.lnum = lnum; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1399 pos.col = search_match_endcol; |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1400 getvcol(curwin, &pos, (colnr_T *)&wlv.tocol, NULL, NULL); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1401 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1402 else |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1403 wlv.tocol = MAXCOL; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1404 // do at least one character; happens when past end of line |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1405 if (wlv.fromcol == wlv.tocol && search_match_endcol) |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1406 wlv.tocol = wlv.fromcol + 1; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1407 area_highlighting = TRUE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1408 vi_attr = HL_ATTR(HLF_I); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1409 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1410 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1411 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1412 #ifdef FEAT_DIFF |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
1413 wlv.filler_lines = diff_check(wp, lnum); |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
1414 if (wlv.filler_lines < 0) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1415 { |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
1416 if (wlv.filler_lines == -1) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1417 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1418 if (diff_find_change(wp, lnum, &change_start, &change_end)) |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1419 wlv.diff_hlf = HLF_ADD; // added line |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1420 else if (change_start == 0) |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1421 wlv.diff_hlf = HLF_TXD; // changed text |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1422 else |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1423 wlv.diff_hlf = HLF_CHD; // changed line |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1424 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1425 else |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1426 wlv.diff_hlf = HLF_ADD; // added line |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
1427 wlv.filler_lines = 0; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1428 area_highlighting = TRUE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1429 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1430 if (lnum == wp->w_topline) |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
1431 wlv.filler_lines = wp->w_topfill; |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
1432 wlv.filler_todo = wlv.filler_lines; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1433 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1434 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1435 #ifdef FEAT_SIGNS |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
1436 sign_present = buf_get_signattrs(wp, lnum, &wlv.sattr); |
26690
84d60deb8f82
patch 8.2.3874: cannot highlight the number column for a sign
Bram Moolenaar <Bram@vim.org>
parents:
26384
diff
changeset
|
1437 if (sign_present) |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
1438 num_attr = wlv.sattr.sat_numhl; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1439 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1440 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1441 #ifdef LINE_ATTR |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1442 # ifdef FEAT_SIGNS |
31297
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
1443 // If this line has a sign with line highlighting set wlv.line_attr. |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1444 if (sign_present) |
31297
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
1445 wlv.line_attr = wlv.sattr.sat_linehl; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1446 # endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1447 # if defined(FEAT_QUICKFIX) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1448 // Highlight the current line in the quickfix window. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1449 if (bt_quickfix(wp->w_buffer) && qf_current_entry(wp) == lnum) |
31297
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
1450 wlv.line_attr = HL_ATTR(HLF_QFL); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1451 # endif |
31297
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
1452 if (wlv.line_attr != 0) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1453 area_highlighting = TRUE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1454 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1455 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1456 line = ml_get_buf(wp->w_buffer, lnum, FALSE); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1457 ptr = line; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1458 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1459 #ifdef FEAT_SPELL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1460 if (has_spell && !number_only) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1461 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1462 // For checking first word with a capital skip white space. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1463 if (cap_col == 0) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1464 cap_col = getwhitecols(line); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1465 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1466 // To be able to spell-check over line boundaries copy the end of the |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1467 // current line into nextline[]. Above the start of the next line was |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1468 // copied to nextline[SPWORDLEN]. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1469 if (nextline[SPWORDLEN] == NUL) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1470 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1471 // No next line or it is empty. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1472 nextlinecol = MAXCOL; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1473 nextline_idx = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1474 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1475 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1476 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1477 v = (long)STRLEN(line); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1478 if (v < SPWORDLEN) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1479 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1480 // Short line, use it completely and append the start of the |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1481 // next line. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1482 nextlinecol = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1483 mch_memmove(nextline, line, (size_t)v); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1484 STRMOVE(nextline + v, nextline + SPWORDLEN); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1485 nextline_idx = v + 1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1486 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1487 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1488 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1489 // Long line, use only the last SPWORDLEN bytes. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1490 nextlinecol = v - SPWORDLEN; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1491 mch_memmove(nextline, line + nextlinecol, SPWORDLEN); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1492 nextline_idx = SPWORDLEN + 1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1493 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1494 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1495 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1496 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1497 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1498 if (wp->w_p_list) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1499 { |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23901
diff
changeset
|
1500 if (wp->w_lcs_chars.space |
25778
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25749
diff
changeset
|
1501 || wp->w_lcs_chars.multispace != NULL |
29090
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
28788
diff
changeset
|
1502 || wp->w_lcs_chars.leadmultispace != NULL |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23901
diff
changeset
|
1503 || wp->w_lcs_chars.trail |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23901
diff
changeset
|
1504 || wp->w_lcs_chars.lead |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23901
diff
changeset
|
1505 || wp->w_lcs_chars.nbsp) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1506 extra_check = TRUE; |
23825
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
22997
diff
changeset
|
1507 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1508 // find start of trailing whitespace |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23901
diff
changeset
|
1509 if (wp->w_lcs_chars.trail) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1510 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1511 trailcol = (colnr_T)STRLEN(ptr); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1512 while (trailcol > (colnr_T)0 && VIM_ISWHITE(ptr[trailcol - 1])) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1513 --trailcol; |
29413
34e93e046526
patch 9.0.0048: cursor in wrong column with mouse click after concealed text
Bram Moolenaar <Bram@vim.org>
parents:
29387
diff
changeset
|
1514 trailcol += (colnr_T)(ptr - line); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1515 } |
23825
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
22997
diff
changeset
|
1516 // find end of leading whitespace |
29090
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
28788
diff
changeset
|
1517 if (wp->w_lcs_chars.lead || wp->w_lcs_chars.leadmultispace != NULL) |
23825
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
22997
diff
changeset
|
1518 { |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
22997
diff
changeset
|
1519 leadcol = 0; |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
22997
diff
changeset
|
1520 while (VIM_ISWHITE(ptr[leadcol])) |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
22997
diff
changeset
|
1521 ++leadcol; |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
22997
diff
changeset
|
1522 if (ptr[leadcol] == NUL) |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
22997
diff
changeset
|
1523 // in a line full of spaces all of them are treated as trailing |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
22997
diff
changeset
|
1524 leadcol = (colnr_T)0; |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
22997
diff
changeset
|
1525 else |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
22997
diff
changeset
|
1526 // keep track of the first column not filled with spaces |
29413
34e93e046526
patch 9.0.0048: cursor in wrong column with mouse click after concealed text
Bram Moolenaar <Bram@vim.org>
parents:
29387
diff
changeset
|
1527 leadcol += (colnr_T)(ptr - line) + 1; |
23825
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
22997
diff
changeset
|
1528 } |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1529 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1530 |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
1531 wlv.wcr_attr = get_wcr_attr(wp); |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
1532 if (wlv.wcr_attr != 0) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1533 { |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
1534 wlv.win_attr = wlv.wcr_attr; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1535 area_highlighting = TRUE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1536 } |
18317
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
1537 |
31371
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1538 // When w_skipcol is non-zero and there is virtual text above the actual |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1539 // text, then this much of the virtual text is skipped. |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1540 int skipcol_in_text_prop_above = 0; |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1541 |
18763
49b78d6465e5
patch 8.1.2371: FEAT_TEXT_PROP is a confusing name
Bram Moolenaar <Bram@vim.org>
parents:
18720
diff
changeset
|
1542 #ifdef FEAT_PROP_POPUP |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1543 if (WIN_IS_POPUP(wp)) |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1544 wlv.screen_line_flags |= SLF_POPUP; |
31371
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1545 |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1546 char_u *prop_start; |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1547 text_prop_count = get_text_props(wp->w_buffer, lnum, &prop_start, FALSE); |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1548 if (text_prop_count > 0) |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1549 { |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1550 // Make a copy of the properties, so that they are properly |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1551 // aligned. |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1552 text_props = ALLOC_MULT(textprop_T, text_prop_count); |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1553 if (text_props != NULL) |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1554 mch_memmove(text_props, prop_start, |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1555 text_prop_count * sizeof(textprop_T)); |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1556 |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1557 // Allocate an array for the indexes. |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1558 text_prop_idxs = ALLOC_MULT(int, text_prop_count); |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1559 if (text_prop_idxs == NULL) |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1560 VIM_CLEAR(text_props); |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1561 |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1562 if (text_props != NULL) |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1563 { |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1564 area_highlighting = TRUE; |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1565 extra_check = TRUE; |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1566 |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1567 // When skipping virtual text the props need to be sorted. The |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1568 // order is reversed! |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1569 if (lnum == wp->w_topline && wp->w_skipcol > 0) |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1570 { |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1571 for (int i = 0; i < text_prop_count; ++i) |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1572 text_prop_idxs[i] = i; |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1573 sort_text_props(wp->w_buffer, text_props, |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1574 text_prop_idxs, text_prop_count); |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1575 } |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1576 |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1577 // Text props "above" move the line number down to where the text |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1578 // is. Only count the ones that are visible, not those that are |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1579 // skipped because of w_skipcol. |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1580 int text_width = wp->w_width - win_col_off(wp); |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1581 for (int i = text_prop_count - 1; i >= 0; --i) |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1582 if (text_props[i].tp_flags & TP_FLAG_ALIGN_ABOVE) |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1583 { |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1584 if (lnum == wp->w_topline |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1585 && wp->w_skipcol - skipcol_in_text_prop_above |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1586 >= text_width) |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1587 { |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1588 // This virtual text above is skipped, remove it from |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1589 // the array. |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1590 skipcol_in_text_prop_above += text_width; |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1591 for (int j = i + 1; j < text_prop_count; ++j) |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1592 text_props[j - 1] = text_props[j]; |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1593 ++i; |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1594 --text_prop_count; |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1595 } |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1596 else |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1597 ++wlv.text_prop_above_count; |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1598 } |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1599 } |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1600 } |
31988
a7801ecf7df9
patch 9.0.1326: relative line number not updated with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31986
diff
changeset
|
1601 |
a7801ecf7df9
patch 9.0.1326: relative line number not updated with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31986
diff
changeset
|
1602 if (number_only) |
a7801ecf7df9
patch 9.0.1326: relative line number not updated with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31986
diff
changeset
|
1603 { |
a7801ecf7df9
patch 9.0.1326: relative line number not updated with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31986
diff
changeset
|
1604 // skip over rows only used for virtual text above |
a7801ecf7df9
patch 9.0.1326: relative line number not updated with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31986
diff
changeset
|
1605 wlv.row += wlv.text_prop_above_count; |
a7801ecf7df9
patch 9.0.1326: relative line number not updated with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31986
diff
changeset
|
1606 if (wlv.row > endrow) |
a7801ecf7df9
patch 9.0.1326: relative line number not updated with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31986
diff
changeset
|
1607 return wlv.row; |
a7801ecf7df9
patch 9.0.1326: relative line number not updated with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31986
diff
changeset
|
1608 wlv.screen_row += wlv.text_prop_above_count; |
a7801ecf7df9
patch 9.0.1326: relative line number not updated with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31986
diff
changeset
|
1609 } |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1610 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1611 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1612 // 'nowrap' or 'wrap' and a single line that doesn't fit: Advance to the |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1613 // first character to be displayed. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1614 if (wp->w_p_wrap) |
31371
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1615 v = startrow == 0 ? wp->w_skipcol - skipcol_in_text_prop_above : 0; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1616 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1617 v = wp->w_leftcol; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1618 if (v > 0 && !number_only) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1619 { |
29451
057c26b5c33a
patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29413
diff
changeset
|
1620 char_u *prev_ptr = ptr; |
057c26b5c33a
patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29413
diff
changeset
|
1621 chartabsize_T cts; |
29461
69693a62f2f4
patch 9.0.0072: compiler warning for uninitialized variable
Bram Moolenaar <Bram@vim.org>
parents:
29451
diff
changeset
|
1622 int charsize = 0; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1623 |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1624 init_chartabsize_arg(&cts, wp, lnum, wlv.vcol, line, ptr); |
29451
057c26b5c33a
patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29413
diff
changeset
|
1625 while (cts.cts_vcol < v && *cts.cts_ptr != NUL) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1626 { |
29451
057c26b5c33a
patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29413
diff
changeset
|
1627 charsize = win_lbr_chartabsize(&cts, NULL); |
057c26b5c33a
patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29413
diff
changeset
|
1628 cts.cts_vcol += charsize; |
057c26b5c33a
patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29413
diff
changeset
|
1629 prev_ptr = cts.cts_ptr; |
057c26b5c33a
patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29413
diff
changeset
|
1630 MB_PTR_ADV(cts.cts_ptr); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1631 } |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1632 wlv.vcol = cts.cts_vcol; |
29451
057c26b5c33a
patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29413
diff
changeset
|
1633 ptr = cts.cts_ptr; |
057c26b5c33a
patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29413
diff
changeset
|
1634 clear_chartabsize_arg(&cts); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1635 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1636 // When: |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1637 // - 'cuc' is set, or |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1638 // - 'colorcolumn' is set, or |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1639 // - 'virtualedit' is set, or |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1640 // - the visual mode is active, |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1641 // the end of the line may be before the start of the displayed part. |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1642 if (wlv.vcol < v && ( |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1643 #ifdef FEAT_SYN_HL |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1644 wp->w_p_cuc || wlv.draw_color_col || |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1645 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1646 virtual_active() || |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1647 (VIsual_active && wp->w_buffer == curwin->w_buffer))) |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1648 wlv.vcol = v; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1649 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1650 // Handle a character that's not completely on the screen: Put ptr at |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1651 // that character but skip the first few screen characters. |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1652 if (wlv.vcol > v) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1653 { |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1654 wlv.vcol -= charsize; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1655 ptr = prev_ptr; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1656 // If the character fits on the screen, don't need to skip it. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1657 // Except for a TAB. |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1658 if (((*mb_ptr2cells)(ptr) >= charsize || *ptr == TAB) |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1659 && wlv.col == 0) |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1660 n_skip = v - wlv.vcol; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1661 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1662 |
30765
3002177fa0b1
patch 9.0.0717: compiler warning for unused variable in tiny build
Bram Moolenaar <Bram@vim.org>
parents:
30763
diff
changeset
|
1663 #ifdef FEAT_PROP_POPUP |
30763
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
1664 // If there the text doesn't reach to the desired column, need to skip |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
1665 // "skip_cells" cells when virtual text follows. |
31371
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1666 if ((!wp->w_p_wrap || (lnum == wp->w_topline && wp->w_skipcol > 0)) |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
1667 && v > wlv.vcol) |
30763
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
1668 skip_cells = v - wlv.vcol; |
30765
3002177fa0b1
patch 9.0.0717: compiler warning for unused variable in tiny build
Bram Moolenaar <Bram@vim.org>
parents:
30763
diff
changeset
|
1669 #endif |
30763
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
1670 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1671 // Adjust for when the inverted text is before the screen, |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1672 // and when the start of the inverted text is before the screen. |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1673 if (wlv.tocol <= wlv.vcol) |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1674 wlv.fromcol = 0; |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1675 else if (wlv.fromcol >= 0 && wlv.fromcol < wlv.vcol) |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1676 wlv.fromcol = wlv.vcol; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1677 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1678 #ifdef FEAT_LINEBREAK |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1679 // When w_skipcol is non-zero, first line needs 'showbreak' |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1680 if (wp->w_p_wrap) |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1681 wlv.need_showbreak = TRUE; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1682 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1683 #ifdef FEAT_SPELL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1684 // When spell checking a word we need to figure out the start of the |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1685 // word and if it's badly spelled or not. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1686 if (has_spell) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1687 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1688 int len; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1689 colnr_T linecol = (colnr_T)(ptr - line); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1690 hlf_T spell_hlf = HLF_COUNT; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1691 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1692 pos = wp->w_cursor; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1693 wp->w_cursor.lnum = lnum; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1694 wp->w_cursor.col = linecol; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1695 len = spell_move_to(wp, FORWARD, TRUE, TRUE, &spell_hlf); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1696 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1697 // spell_move_to() may call ml_get() and make "line" invalid |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1698 line = ml_get_buf(wp->w_buffer, lnum, FALSE); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1699 ptr = line + linecol; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1700 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1701 if (len == 0 || (int)wp->w_cursor.col > ptr - line) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1702 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1703 // no bad word found at line start, don't check until end of a |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1704 // word |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1705 spell_hlf = HLF_COUNT; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1706 word_end = (int)(spell_to_word_end(ptr, wp) - line + 1); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1707 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1708 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1709 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1710 // bad word found, use attributes until end of word |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1711 word_end = wp->w_cursor.col + len + 1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1712 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1713 // Turn index into actual attributes. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1714 if (spell_hlf != HLF_COUNT) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1715 spell_attr = highlight_attr[spell_hlf]; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1716 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1717 wp->w_cursor = pos; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1718 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1719 # ifdef FEAT_SYN_HL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1720 // Need to restart syntax highlighting for this line. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1721 if (has_syntax) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1722 syntax_start(wp, lnum); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1723 # endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1724 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1725 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1726 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1727 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1728 // Correct highlighting for cursor that can't be disabled. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1729 // Avoids having to check this for each character. |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1730 if (wlv.fromcol >= 0) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1731 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1732 if (noinvcur) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1733 { |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1734 if ((colnr_T)wlv.fromcol == wp->w_virtcol) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1735 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1736 // highlighting starts at cursor, let it start just after the |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1737 // cursor |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1738 fromcol_prev = wlv.fromcol; |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1739 wlv.fromcol = -1; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1740 } |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1741 else if ((colnr_T)wlv.fromcol < wp->w_virtcol) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1742 // restart highlighting after the cursor |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1743 fromcol_prev = wp->w_virtcol; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1744 } |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1745 if (wlv.fromcol >= wlv.tocol) |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1746 wlv.fromcol = -1; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1747 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1748 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1749 #ifdef FEAT_SEARCH_EXTRA |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1750 if (!number_only) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1751 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1752 v = (long)(ptr - line); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1753 area_highlighting |= prepare_search_hl_line(wp, lnum, (colnr_T)v, |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1754 &line, &screen_search_hl, |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1755 &search_attr); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1756 ptr = line + v; // "line" may have been updated |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1757 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1758 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1759 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1760 #ifdef FEAT_SYN_HL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1761 // Cursor line highlighting for 'cursorline' in the current window. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1762 if (wp->w_p_cul && lnum == wp->w_cursor.lnum) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1763 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1764 // Do not show the cursor line in the text when Visual mode is active, |
28177
f04a3ec65e2d
patch 8.2.4614: redrawing too much when 'cursorline' is set
Bram Moolenaar <Bram@vim.org>
parents:
28169
diff
changeset
|
1765 // because it's not clear what is selected then. |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1766 if (!(wp == curwin && VIsual_active) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1767 && wp->w_p_culopt_flags != CULOPT_NBR) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1768 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1769 wlv.cul_screenline = (wp->w_p_wrap |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1770 && (wp->w_p_culopt_flags & CULOPT_SCRLINE)); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1771 |
31431
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
1772 // Only apply CursorLine highlight here when "screenline" is not |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
1773 // present in 'cursorlineopt'. Otherwise it's done later. |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1774 if (!wlv.cul_screenline) |
31431
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
1775 apply_cursorline_highlight(&wlv, sign_present); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1776 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1777 { |
31297
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
1778 line_attr_save = wlv.line_attr; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1779 margin_columns_win(wp, &left_curline_col, &right_curline_col); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1780 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1781 area_highlighting = TRUE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1782 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1783 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1784 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1785 |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1786 win_line_start(wp, &wlv, FALSE); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1787 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1788 // Repeat for the whole displayed line. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1789 for (;;) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1790 { |
29413
34e93e046526
patch 9.0.0048: cursor in wrong column with mouse click after concealed text
Bram Moolenaar <Bram@vim.org>
parents:
29387
diff
changeset
|
1791 char_u *prev_ptr = ptr; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1792 #if defined(FEAT_CONCEAL) || defined(FEAT_SEARCH_EXTRA) |
29413
34e93e046526
patch 9.0.0048: cursor in wrong column with mouse click after concealed text
Bram Moolenaar <Bram@vim.org>
parents:
29387
diff
changeset
|
1793 int has_match_conc = 0; // match wants to conceal |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1794 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1795 #ifdef FEAT_CONCEAL |
29413
34e93e046526
patch 9.0.0048: cursor in wrong column with mouse click after concealed text
Bram Moolenaar <Bram@vim.org>
parents:
29387
diff
changeset
|
1796 int did_decrement_ptr = FALSE; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1797 #endif |
29413
34e93e046526
patch 9.0.0048: cursor in wrong column with mouse click after concealed text
Bram Moolenaar <Bram@vim.org>
parents:
29387
diff
changeset
|
1798 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1799 // Skip this quickly when working on the text. |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1800 if (wlv.draw_state != WL_LINE) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1801 { |
25517
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
25170
diff
changeset
|
1802 #ifdef FEAT_SYN_HL |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1803 if (wlv.cul_screenline) |
25517
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
25170
diff
changeset
|
1804 { |
30395
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
1805 wlv.cul_attr = 0; |
31297
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
1806 wlv.line_attr = line_attr_save; |
25517
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
25170
diff
changeset
|
1807 } |
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
25170
diff
changeset
|
1808 #endif |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1809 if (wlv.draw_state == WL_CMDLINE - 1 && wlv.n_extra == 0) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1810 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1811 wlv.draw_state = WL_CMDLINE; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1812 if (cmdwin_type != 0 && wp == curwin) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1813 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1814 // Draw the cmdline character. |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1815 wlv.n_extra = 1; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1816 wlv.c_extra = cmdwin_type; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1817 wlv.c_final = NUL; |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
1818 wlv.char_attr = |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
1819 hl_combine_attr(wlv.wcr_attr, HL_ATTR(HLF_AT)); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1820 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1821 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1822 #ifdef FEAT_FOLDING |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1823 if (wlv.draw_state == WL_FOLD - 1 && wlv.n_extra == 0) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1824 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1825 wlv.draw_state = WL_FOLD; |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1826 handle_foldcolumn(wp, &wlv); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1827 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1828 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1829 #ifdef FEAT_SIGNS |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1830 if (wlv.draw_state == WL_SIGN - 1 && wlv.n_extra == 0) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1831 { |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
1832 // Show the sign column when desired or when using Netbeans. |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1833 wlv.draw_state = WL_SIGN; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1834 if (signcolumn_on(wp)) |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
1835 get_sign_display_info(FALSE, wp, &wlv); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1836 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1837 #endif |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1838 if (wlv.draw_state == WL_NR - 1 && wlv.n_extra == 0) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1839 { |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
1840 // Show the line number, if desired. |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1841 wlv.draw_state = WL_NR; |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1842 handle_lnum_col(wp, &wlv, sign_present, num_attr); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1843 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1844 #ifdef FEAT_LINEBREAK |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1845 // Check if 'breakindent' applies and show it. |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1846 // May change wlv.draw_state to WL_BRI or WL_BRI - 1. |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1847 if (wlv.n_extra == 0) |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1848 handle_breakindent(wp, &wlv); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1849 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1850 #if defined(FEAT_LINEBREAK) || defined(FEAT_DIFF) |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1851 if (wlv.draw_state == WL_SBR - 1 && wlv.n_extra == 0) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1852 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1853 wlv.draw_state = WL_SBR; |
30395
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
1854 handle_showbreak_and_filler(wp, &wlv); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1855 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1856 #endif |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1857 if (wlv.draw_state == WL_LINE - 1 && wlv.n_extra == 0) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1858 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1859 wlv.draw_state = WL_LINE; |
30395
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
1860 win_line_continue(&wlv); // use wlv.saved_ values |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1861 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1862 } |
30395
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
1863 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1864 #ifdef FEAT_SYN_HL |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1865 if (wlv.cul_screenline && wlv.draw_state == WL_LINE |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1866 && wlv.vcol >= left_curline_col |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1867 && wlv.vcol < right_curline_col) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1868 { |
31431
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
31371
diff
changeset
|
1869 apply_cursorline_highlight(&wlv, sign_present); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1870 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1871 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1872 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1873 // When still displaying '$' of change command, stop at cursor. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1874 // When only displaying the (relative) line number and that's done, |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1875 // stop here. |
20905
802bf80bcfe4
patch 8.2.1004: line numbers below filler lines not always updated
Bram Moolenaar <Bram@vim.org>
parents:
20782
diff
changeset
|
1876 if (((dollar_vcol >= 0 && wp == curwin |
31986
e0e1ba7daaf4
patch 9.0.1325: 'colorcolumn' highlight wrong with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31944
diff
changeset
|
1877 && lnum == wp->w_cursor.lnum |
e0e1ba7daaf4
patch 9.0.1325: 'colorcolumn' highlight wrong with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31944
diff
changeset
|
1878 && wlv.vcol >= (long)wp->w_virtcol) |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1879 || (number_only && wlv.draw_state > WL_NR)) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1880 #ifdef FEAT_DIFF |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
1881 && wlv.filler_todo <= 0 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1882 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1883 ) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1884 { |
30628
2d7905da4e82
patch 9.0.0649: no indication the first line is broken for 'smoothscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30614
diff
changeset
|
1885 wlv_screen_line(wp, &wlv, TRUE); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1886 // Pretend we have finished updating the window. Except when |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1887 // 'cursorcolumn' is set. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1888 #ifdef FEAT_SYN_HL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1889 if (wp->w_p_cuc) |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1890 wlv.row = wp->w_cline_row + wp->w_cline_height; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1891 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1892 #endif |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1893 wlv.row = wp->w_height; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1894 break; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1895 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1896 |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1897 if (wlv.draw_state == WL_LINE && (area_highlighting || extra_check)) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1898 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1899 // handle Visual or match highlighting in this line |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1900 if (wlv.vcol == wlv.fromcol |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1901 || (has_mbyte && wlv.vcol + 1 == wlv.fromcol |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1902 && wlv.n_extra == 0 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1903 && (*mb_ptr2cells)(ptr) > 1) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1904 || ((int)vcol_prev == fromcol_prev |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1905 && vcol_prev < wlv.vcol // not at margin |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1906 && wlv.vcol < wlv.tocol)) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1907 area_attr = vi_attr; // start highlighting |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1908 else if (area_attr != 0 |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1909 && (wlv.vcol == wlv.tocol |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
1910 || (noinvcur && (colnr_T)wlv.vcol == wp->w_virtcol))) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1911 area_attr = 0; // stop highlighting |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1912 |
18763
49b78d6465e5
patch 8.1.2371: FEAT_TEXT_PROP is a confusing name
Bram Moolenaar <Bram@vim.org>
parents:
18720
diff
changeset
|
1913 #ifdef FEAT_PROP_POPUP |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1914 if (text_props != NULL) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1915 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1916 int pi; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1917 int bcol = (int)(ptr - line); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1918 |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1919 if (wlv.n_extra > 0 |
26338
4cf208415483
patch 8.2.3700: text property highlighting continues over breakindent
Bram Moolenaar <Bram@vim.org>
parents:
26334
diff
changeset
|
1920 # ifdef FEAT_LINEBREAK |
4cf208415483
patch 8.2.3700: text property highlighting continues over breakindent
Bram Moolenaar <Bram@vim.org>
parents:
26334
diff
changeset
|
1921 && !in_linebreak |
4cf208415483
patch 8.2.3700: text property highlighting continues over breakindent
Bram Moolenaar <Bram@vim.org>
parents:
26334
diff
changeset
|
1922 # endif |
4cf208415483
patch 8.2.3700: text property highlighting continues over breakindent
Bram Moolenaar <Bram@vim.org>
parents:
26334
diff
changeset
|
1923 ) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1924 --bcol; // still working on the previous char, e.g. Tab |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1925 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1926 // Check if any active property ends. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1927 for (pi = 0; pi < text_props_active; ++pi) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1928 { |
31938
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
1929 int tpi = text_prop_idxs[pi]; |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
1930 textprop_T *tp = &text_props[tpi]; |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
1931 |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
1932 // An inline property ends when after the start column plus |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
1933 // length. An "above" property ends when used and n_extra |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
1934 // is zero. |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
1935 if ((tp->tp_col != MAXCOL |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
1936 && bcol >= tp->tp_col - 1 + tp->tp_len)) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1937 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1938 if (pi + 1 < text_props_active) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1939 mch_memmove(text_prop_idxs + pi, |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1940 text_prop_idxs + pi + 1, |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1941 sizeof(int) |
31938
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
1942 * (text_props_active - (pi + 1))); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1943 --text_props_active; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1944 --pi; |
26338
4cf208415483
patch 8.2.3700: text property highlighting continues over breakindent
Bram Moolenaar <Bram@vim.org>
parents:
26334
diff
changeset
|
1945 # ifdef FEAT_LINEBREAK |
4cf208415483
patch 8.2.3700: text property highlighting continues over breakindent
Bram Moolenaar <Bram@vim.org>
parents:
26334
diff
changeset
|
1946 // not exactly right but should work in most cases |
30039
4b9b237d1211
patch 9.0.0357: 'linebreak' interferes with text property highlight
Bram Moolenaar <Bram@vim.org>
parents:
29918
diff
changeset
|
1947 if (in_linebreak && syntax_attr == text_prop_attr_comb) |
26338
4cf208415483
patch 8.2.3700: text property highlighting continues over breakindent
Bram Moolenaar <Bram@vim.org>
parents:
26334
diff
changeset
|
1948 syntax_attr = 0; |
4cf208415483
patch 8.2.3700: text property highlighting continues over breakindent
Bram Moolenaar <Bram@vim.org>
parents:
26334
diff
changeset
|
1949 # endif |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1950 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1951 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1952 |
26384
e624b4ddbdf0
patch 8.2.3723: when using 'linebreak' a text property starts too early
Bram Moolenaar <Bram@vim.org>
parents:
26374
diff
changeset
|
1953 # ifdef FEAT_LINEBREAK |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
1954 if (wlv.n_extra > 0 && in_linebreak) |
26384
e624b4ddbdf0
patch 8.2.3723: when using 'linebreak' a text property starts too early
Bram Moolenaar <Bram@vim.org>
parents:
26374
diff
changeset
|
1955 // not on the next char yet, don't start another prop |
e624b4ddbdf0
patch 8.2.3723: when using 'linebreak' a text property starts too early
Bram Moolenaar <Bram@vim.org>
parents:
26374
diff
changeset
|
1956 --bcol; |
e624b4ddbdf0
patch 8.2.3723: when using 'linebreak' a text property starts too early
Bram Moolenaar <Bram@vim.org>
parents:
26374
diff
changeset
|
1957 # endif |
31938
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
1958 int display_text_first = FALSE; |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
1959 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1960 // Add any text property that starts in this column. |
29635
592818fd3110
patch 9.0.0158: with 'nowrap' "below" property not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
29633
diff
changeset
|
1961 // With 'nowrap' and not in the first screen line only "below" |
592818fd3110
patch 9.0.0158: with 'nowrap' "below" property not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
29633
diff
changeset
|
1962 // text prop can show. |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1963 while (text_prop_next < text_prop_count |
29560
14b139cbec49
patch 9.0.0121: cannot put virtual text after or below a line
Bram Moolenaar <Bram@vim.org>
parents:
29550
diff
changeset
|
1964 && (text_props[text_prop_next].tp_col == MAXCOL |
30205
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
1965 ? ((*ptr == NUL |
29635
592818fd3110
patch 9.0.0158: with 'nowrap' "below" property not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
29633
diff
changeset
|
1966 && (wp->w_p_wrap |
592818fd3110
patch 9.0.0158: with 'nowrap' "below" property not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
29633
diff
changeset
|
1967 || wlv.row == startrow |
592818fd3110
patch 9.0.0158: with 'nowrap' "below" property not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
29633
diff
changeset
|
1968 || (text_props[text_prop_next].tp_flags |
592818fd3110
patch 9.0.0158: with 'nowrap' "below" property not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
29633
diff
changeset
|
1969 & TP_FLAG_ALIGN_BELOW))) |
31938
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
1970 || (bcol == 0 |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
1971 && (text_props[text_prop_next].tp_flags |
30205
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
1972 & TP_FLAG_ALIGN_ABOVE))) |
29560
14b139cbec49
patch 9.0.0121: cannot put virtual text after or below a line
Bram Moolenaar <Bram@vim.org>
parents:
29550
diff
changeset
|
1973 : bcol >= text_props[text_prop_next].tp_col - 1)) |
23901
6793853063e5
patch 8.2.2493: text property for text left of window shows up
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
1974 { |
29722
f88671dbe88b
patch 9.0.0201: CursorLine highlight overrules virtual text highlight
Bram Moolenaar <Bram@vim.org>
parents:
29706
diff
changeset
|
1975 if (text_props[text_prop_next].tp_col == MAXCOL |
f88671dbe88b
patch 9.0.0201: CursorLine highlight overrules virtual text highlight
Bram Moolenaar <Bram@vim.org>
parents:
29706
diff
changeset
|
1976 || bcol <= text_props[text_prop_next].tp_col - 1 |
23901
6793853063e5
patch 8.2.2493: text property for text left of window shows up
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
1977 + text_props[text_prop_next].tp_len) |
6793853063e5
patch 8.2.2493: text property for text left of window shows up
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
1978 text_prop_idxs[text_props_active++] = text_prop_next; |
6793853063e5
patch 8.2.2493: text property for text left of window shows up
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
1979 ++text_prop_next; |
6793853063e5
patch 8.2.2493: text property for text left of window shows up
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
1980 } |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1981 |
31113
6ff733178f8b
patch 9.0.0891: virtual text below after match has wrong highlight
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
1982 if (wlv.n_extra == 0 || !wlv.extra_for_textprop) |
29736
65348cc3b656
patch 9.0.0208: the override flag has no effect for virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29722
diff
changeset
|
1983 { |
65348cc3b656
patch 9.0.0208: the override flag has no effect for virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29722
diff
changeset
|
1984 text_prop_attr = 0; |
30039
4b9b237d1211
patch 9.0.0357: 'linebreak' interferes with text property highlight
Bram Moolenaar <Bram@vim.org>
parents:
29918
diff
changeset
|
1985 text_prop_attr_comb = 0; |
29736
65348cc3b656
patch 9.0.0208: the override flag has no effect for virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29722
diff
changeset
|
1986 text_prop_flags = 0; |
65348cc3b656
patch 9.0.0208: the override flag has no effect for virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29722
diff
changeset
|
1987 text_prop_type = NULL; |
65348cc3b656
patch 9.0.0208: the override flag has no effect for virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29722
diff
changeset
|
1988 text_prop_id = 0; |
31221
59de2172e99d
patch 9.0.0944: 'cursorline' causes virtual text highlight to continue
Bram Moolenaar <Bram@vim.org>
parents:
31142
diff
changeset
|
1989 reset_extra_attr = FALSE; |
29736
65348cc3b656
patch 9.0.0208: the override flag has no effect for virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29722
diff
changeset
|
1990 } |
31938
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
1991 if (text_props_active > 0 && wlv.n_extra == 0 |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
1992 && !display_text_first) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1993 { |
29467
5b3819ce0865
patch 9.0.0075: some compilers warn for using an uninitialized variable
Bram Moolenaar <Bram@vim.org>
parents:
29461
diff
changeset
|
1994 int used_tpi = -1; |
29451
057c26b5c33a
patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29413
diff
changeset
|
1995 int used_attr = 0; |
29560
14b139cbec49
patch 9.0.0121: cannot put virtual text after or below a line
Bram Moolenaar <Bram@vim.org>
parents:
29550
diff
changeset
|
1996 int other_tpi = -1; |
29451
057c26b5c33a
patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29413
diff
changeset
|
1997 |
31938
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
1998 text_prop_above = FALSE; |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
1999 text_prop_follows = FALSE; |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
2000 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2001 // Sort the properties on priority and/or starting last. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2002 // Then combine the attributes, highest priority last. |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
2003 sort_text_props(wp->w_buffer, text_props, |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
2004 text_prop_idxs, text_props_active); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2005 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2006 for (pi = 0; pi < text_props_active; ++pi) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2007 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2008 int tpi = text_prop_idxs[pi]; |
30749
6fe513996997
patch 9.0.0709: virtual text "after" not correct with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
30741
diff
changeset
|
2009 textprop_T *tp = &text_props[tpi]; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2010 proptype_T *pt = text_prop_type_by_id( |
30763
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2011 wp->w_buffer, tp->tp_type); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2012 |
30763
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2013 // Only use a text property that can be displayed. |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2014 // Skip "after" properties when wrap is off and at the |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2015 // end of the window. |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2016 if (pt != NULL |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2017 && (pt->pt_hl_id > 0 || tp->tp_id < 0) |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2018 && tp->tp_id != -MAXCOL |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2019 && !(tp->tp_id < 0 |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2020 && !wp->w_p_wrap |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2021 && (tp->tp_flags & (TP_FLAG_ALIGN_RIGHT |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2022 | TP_FLAG_ALIGN_ABOVE |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2023 | TP_FLAG_ALIGN_BELOW)) == 0 |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2024 && wlv.col >= wp->w_width)) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2025 { |
31944
87ed5e064db2
patch 9.0.1304: "$" for 'list' option displayed in wrong position
Bram Moolenaar <Bram@vim.org>
parents:
31938
diff
changeset
|
2026 if (tp->tp_col == MAXCOL |
87ed5e064db2
patch 9.0.1304: "$" for 'list' option displayed in wrong position
Bram Moolenaar <Bram@vim.org>
parents:
31938
diff
changeset
|
2027 && *ptr == NUL |
87ed5e064db2
patch 9.0.1304: "$" for 'list' option displayed in wrong position
Bram Moolenaar <Bram@vim.org>
parents:
31938
diff
changeset
|
2028 && ((wp->w_p_list && lcs_eol_one > 0 |
87ed5e064db2
patch 9.0.1304: "$" for 'list' option displayed in wrong position
Bram Moolenaar <Bram@vim.org>
parents:
31938
diff
changeset
|
2029 && (tp->tp_flags |
87ed5e064db2
patch 9.0.1304: "$" for 'list' option displayed in wrong position
Bram Moolenaar <Bram@vim.org>
parents:
31938
diff
changeset
|
2030 & TP_FLAG_ALIGN_ABOVE) == 0) |
87ed5e064db2
patch 9.0.1304: "$" for 'list' option displayed in wrong position
Bram Moolenaar <Bram@vim.org>
parents:
31938
diff
changeset
|
2031 || (ptr == line |
87ed5e064db2
patch 9.0.1304: "$" for 'list' option displayed in wrong position
Bram Moolenaar <Bram@vim.org>
parents:
31938
diff
changeset
|
2032 && !did_line |
87ed5e064db2
patch 9.0.1304: "$" for 'list' option displayed in wrong position
Bram Moolenaar <Bram@vim.org>
parents:
31938
diff
changeset
|
2033 && (tp->tp_flags |
87ed5e064db2
patch 9.0.1304: "$" for 'list' option displayed in wrong position
Bram Moolenaar <Bram@vim.org>
parents:
31938
diff
changeset
|
2034 & TP_FLAG_ALIGN_BELOW)))) |
87ed5e064db2
patch 9.0.1304: "$" for 'list' option displayed in wrong position
Bram Moolenaar <Bram@vim.org>
parents:
31938
diff
changeset
|
2035 { |
87ed5e064db2
patch 9.0.1304: "$" for 'list' option displayed in wrong position
Bram Moolenaar <Bram@vim.org>
parents:
31938
diff
changeset
|
2036 // skip this prop, first display the '$' after |
87ed5e064db2
patch 9.0.1304: "$" for 'list' option displayed in wrong position
Bram Moolenaar <Bram@vim.org>
parents:
31938
diff
changeset
|
2037 // the line or display an empty line |
87ed5e064db2
patch 9.0.1304: "$" for 'list' option displayed in wrong position
Bram Moolenaar <Bram@vim.org>
parents:
31938
diff
changeset
|
2038 text_prop_follows = TRUE; |
87ed5e064db2
patch 9.0.1304: "$" for 'list' option displayed in wrong position
Bram Moolenaar <Bram@vim.org>
parents:
31938
diff
changeset
|
2039 if (used_tpi < 0) |
87ed5e064db2
patch 9.0.1304: "$" for 'list' option displayed in wrong position
Bram Moolenaar <Bram@vim.org>
parents:
31938
diff
changeset
|
2040 display_text_first = TRUE; |
87ed5e064db2
patch 9.0.1304: "$" for 'list' option displayed in wrong position
Bram Moolenaar <Bram@vim.org>
parents:
31938
diff
changeset
|
2041 continue; |
87ed5e064db2
patch 9.0.1304: "$" for 'list' option displayed in wrong position
Bram Moolenaar <Bram@vim.org>
parents:
31938
diff
changeset
|
2042 } |
87ed5e064db2
patch 9.0.1304: "$" for 'list' option displayed in wrong position
Bram Moolenaar <Bram@vim.org>
parents:
31938
diff
changeset
|
2043 |
29698
b944b7fb563b
patch 9.0.0189: invalid memory access for text prop without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29692
diff
changeset
|
2044 if (pt->pt_hl_id > 0) |
b944b7fb563b
patch 9.0.0189: invalid memory access for text prop without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29692
diff
changeset
|
2045 used_attr = syn_id2attr(pt->pt_hl_id); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2046 text_prop_type = pt; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2047 text_prop_attr = |
29451
057c26b5c33a
patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29413
diff
changeset
|
2048 hl_combine_attr(text_prop_attr, used_attr); |
31788
7d0025a2940a
patch 9.0.1226: spurious empty line when using text properties
Bram Moolenaar <Bram@vim.org>
parents:
31618
diff
changeset
|
2049 if (used_tpi >= 0 && text_props[used_tpi].tp_id < 0) |
7d0025a2940a
patch 9.0.1226: spurious empty line when using text properties
Bram Moolenaar <Bram@vim.org>
parents:
31618
diff
changeset
|
2050 other_tpi = used_tpi; |
29611
608d5221a3e5
patch 9.0.0146: missing part of change for "override" flag
Bram Moolenaar <Bram@vim.org>
parents:
29597
diff
changeset
|
2051 text_prop_flags = pt->pt_flags; |
30749
6fe513996997
patch 9.0.0709: virtual text "after" not correct with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
30741
diff
changeset
|
2052 text_prop_id = tp->tp_id; |
29451
057c26b5c33a
patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29413
diff
changeset
|
2053 used_tpi = tpi; |
31944
87ed5e064db2
patch 9.0.1304: "$" for 'list' option displayed in wrong position
Bram Moolenaar <Bram@vim.org>
parents:
31938
diff
changeset
|
2054 display_text_first = FALSE; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2055 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2056 } |
29560
14b139cbec49
patch 9.0.0121: cannot put virtual text after or below a line
Bram Moolenaar <Bram@vim.org>
parents:
29550
diff
changeset
|
2057 if (text_prop_id < 0 && used_tpi >= 0 |
29451
057c26b5c33a
patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29413
diff
changeset
|
2058 && -text_prop_id |
057c26b5c33a
patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29413
diff
changeset
|
2059 <= wp->w_buffer->b_textprop_text.ga_len) |
057c26b5c33a
patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29413
diff
changeset
|
2060 { |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
2061 textprop_T *tp = &text_props[used_tpi]; |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
2062 char_u *p = ((char_u **)wp->w_buffer |
29451
057c26b5c33a
patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29413
diff
changeset
|
2063 ->b_textprop_text.ga_data)[ |
057c26b5c33a
patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29413
diff
changeset
|
2064 -text_prop_id - 1]; |
30231
0d084880276a
patch 9.0.0451: virtual text "above" does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
30213
diff
changeset
|
2065 int above = (tp->tp_flags |
0d084880276a
patch 9.0.0451: virtual text "above" does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
30213
diff
changeset
|
2066 & TP_FLAG_ALIGN_ABOVE); |
30759
b41ccaa6fd84
patch 9.0.0714: with 'nowrap' two virtual text below not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
30749
diff
changeset
|
2067 int bail_out = FALSE; |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2068 |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2069 // reset the ID in the copy to avoid it being used |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2070 // again |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
2071 tp->tp_id = -MAXCOL; |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2072 |
29451
057c26b5c33a
patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29413
diff
changeset
|
2073 if (p != NULL) |
057c26b5c33a
patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29413
diff
changeset
|
2074 { |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
2075 int right = (tp->tp_flags |
29560
14b139cbec49
patch 9.0.0121: cannot put virtual text after or below a line
Bram Moolenaar <Bram@vim.org>
parents:
29550
diff
changeset
|
2076 & TP_FLAG_ALIGN_RIGHT); |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
2077 int below = (tp->tp_flags |
29560
14b139cbec49
patch 9.0.0121: cannot put virtual text after or below a line
Bram Moolenaar <Bram@vim.org>
parents:
29550
diff
changeset
|
2078 & TP_FLAG_ALIGN_BELOW); |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
2079 int wrap = (tp->tp_flags & TP_FLAG_WRAP); |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
2080 int padding = tp->tp_col == MAXCOL |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
2081 && tp->tp_len > 1 |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
2082 ? tp->tp_len - 1 : 0; |
29560
14b139cbec49
patch 9.0.0121: cannot put virtual text after or below a line
Bram Moolenaar <Bram@vim.org>
parents:
29550
diff
changeset
|
2083 |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
2084 // Insert virtual text before the current |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
2085 // character, or add after the end of the line. |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2086 wlv.p_extra = p; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2087 wlv.c_extra = NUL; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2088 wlv.c_final = NUL; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2089 wlv.n_extra = (int)STRLEN(p); |
31113
6ff733178f8b
patch 9.0.0891: virtual text below after match has wrong highlight
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2090 wlv.extra_for_textprop = TRUE; |
31119
e2c909e06424
patch 9.0.0894: virtual text property highlight ignores window background
Bram Moolenaar <Bram@vim.org>
parents:
31113
diff
changeset
|
2091 wlv.extra_attr = hl_combine_attr(wlv.win_attr, |
e2c909e06424
patch 9.0.0894: virtual text property highlight ignores window background
Bram Moolenaar <Bram@vim.org>
parents:
31113
diff
changeset
|
2092 used_attr); |
29583
32aee589fc9a
patch 9.0.0132: multi-byte characters in virtual text not handled correctly
Bram Moolenaar <Bram@vim.org>
parents:
29579
diff
changeset
|
2093 n_attr = mb_charlen(p); |
30233
8d660a45299f
patch 9.0.0452: Visual highlighting extends into virtual text prop
Bram Moolenaar <Bram@vim.org>
parents:
30231
diff
changeset
|
2094 // restore search_attr and area_attr when n_extra |
8d660a45299f
patch 9.0.0452: Visual highlighting extends into virtual text prop
Bram Moolenaar <Bram@vim.org>
parents:
30231
diff
changeset
|
2095 // is down to zero |
29706
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2096 saved_search_attr = search_attr; |
30233
8d660a45299f
patch 9.0.0452: Visual highlighting extends into virtual text prop
Bram Moolenaar <Bram@vim.org>
parents:
30231
diff
changeset
|
2097 saved_area_attr = area_attr; |
8d660a45299f
patch 9.0.0452: Visual highlighting extends into virtual text prop
Bram Moolenaar <Bram@vim.org>
parents:
30231
diff
changeset
|
2098 search_attr = 0; |
8d660a45299f
patch 9.0.0452: Visual highlighting extends into virtual text prop
Bram Moolenaar <Bram@vim.org>
parents:
30231
diff
changeset
|
2099 area_attr = 0; |
29451
057c26b5c33a
patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29413
diff
changeset
|
2100 text_prop_attr = 0; |
30039
4b9b237d1211
patch 9.0.0357: 'linebreak' interferes with text property highlight
Bram Moolenaar <Bram@vim.org>
parents:
29918
diff
changeset
|
2101 text_prop_attr_comb = 0; |
29560
14b139cbec49
patch 9.0.0121: cannot put virtual text after or below a line
Bram Moolenaar <Bram@vim.org>
parents:
29550
diff
changeset
|
2102 if (*ptr == NUL) |
14b139cbec49
patch 9.0.0121: cannot put virtual text after or below a line
Bram Moolenaar <Bram@vim.org>
parents:
29550
diff
changeset
|
2103 // don't combine char attr after EOL |
29611
608d5221a3e5
patch 9.0.0146: missing part of change for "override" flag
Bram Moolenaar <Bram@vim.org>
parents:
29597
diff
changeset
|
2104 text_prop_flags &= ~PT_FLAG_COMBINE; |
29615
bab343b21da8
patch 9.0.0148: a "below" aligned text property gets 'showbreak' displayed
Bram Moolenaar <Bram@vim.org>
parents:
29611
diff
changeset
|
2105 #ifdef FEAT_LINEBREAK |
30205
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
2106 if (above || below || right || !wrap) |
29615
bab343b21da8
patch 9.0.0148: a "below" aligned text property gets 'showbreak' displayed
Bram Moolenaar <Bram@vim.org>
parents:
29611
diff
changeset
|
2107 { |
bab343b21da8
patch 9.0.0148: a "below" aligned text property gets 'showbreak' displayed
Bram Moolenaar <Bram@vim.org>
parents:
29611
diff
changeset
|
2108 // no 'showbreak' before "below" text property |
30205
ed6f3d2593df
patch 9.0.0438: cannot put virtual text above a line
Bram Moolenaar <Bram@vim.org>
parents:
30039
diff
changeset
|
2109 // or after "above" or "right" text property |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
2110 wlv.need_showbreak = FALSE; |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
2111 wlv.dont_use_showbreak = TRUE; |
29615
bab343b21da8
patch 9.0.0148: a "below" aligned text property gets 'showbreak' displayed
Bram Moolenaar <Bram@vim.org>
parents:
29611
diff
changeset
|
2112 } |
bab343b21da8
patch 9.0.0148: a "below" aligned text property gets 'showbreak' displayed
Bram Moolenaar <Bram@vim.org>
parents:
29611
diff
changeset
|
2113 #endif |
30213
4fedacdad3b4
patch 9.0.0442: virtual text "above" doesn't handel line numbers
Bram Moolenaar <Bram@vim.org>
parents:
30205
diff
changeset
|
2114 if ((right || above || below || !wrap |
4fedacdad3b4
patch 9.0.0442: virtual text "above" doesn't handel line numbers
Bram Moolenaar <Bram@vim.org>
parents:
30205
diff
changeset
|
2115 || padding > 0) && wp->w_width > 2) |
29560
14b139cbec49
patch 9.0.0121: cannot put virtual text after or below a line
Bram Moolenaar <Bram@vim.org>
parents:
29550
diff
changeset
|
2116 { |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
2117 char_u *prev_p_extra = wlv.p_extra; |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
2118 int start_line; |
29740
b167c91b5f6b
patch 9.0.0210: 'list' mode does not work properly with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29738
diff
changeset
|
2119 |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
2120 // Take care of padding, right-align and |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
2121 // truncation. |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
2122 // Shared with win_lbr_chartabsize(), must do |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
2123 // exactly the same. |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
2124 start_line = text_prop_position(wp, tp, |
30749
6fe513996997
patch 9.0.0709: virtual text "after" not correct with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
30741
diff
changeset
|
2125 wlv.vcol, |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
2126 wlv.col, |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
2127 &wlv.n_extra, &wlv.p_extra, |
31371
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
2128 &n_attr, &wlv.n_attr_skip, |
1c43d8bad31d
patch 9.0.1019: 'smoothscroll' and virtual text above don't work together
Bram Moolenaar <Bram@vim.org>
parents:
31323
diff
changeset
|
2129 skip_cells > 0); |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
2130 if (wlv.p_extra != prev_p_extra) |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
2131 { |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
2132 // wlv.p_extra was allocated |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
2133 vim_free(p_extra_free2); |
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
2134 p_extra_free2 = wlv.p_extra; |
29560
14b139cbec49
patch 9.0.0121: cannot put virtual text after or below a line
Bram Moolenaar <Bram@vim.org>
parents:
29550
diff
changeset
|
2135 } |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2136 |
31986
e0e1ba7daaf4
patch 9.0.1325: 'colorcolumn' highlight wrong with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31944
diff
changeset
|
2137 if (above) |
e0e1ba7daaf4
patch 9.0.1325: 'colorcolumn' highlight wrong with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31944
diff
changeset
|
2138 wlv.vcol_off_tp = wlv.n_extra; |
e0e1ba7daaf4
patch 9.0.1325: 'colorcolumn' highlight wrong with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31944
diff
changeset
|
2139 |
31142
7b16ac81a349
patch 9.0.0905: virtual text after the line wraps when 'wrap' is off
Bram Moolenaar <Bram@vim.org>
parents:
31119
diff
changeset
|
2140 if (lcs_eol_one < 0 |
7b16ac81a349
patch 9.0.0905: virtual text after the line wraps when 'wrap' is off
Bram Moolenaar <Bram@vim.org>
parents:
31119
diff
changeset
|
2141 && wp->w_p_wrap |
7b16ac81a349
patch 9.0.0905: virtual text after the line wraps when 'wrap' is off
Bram Moolenaar <Bram@vim.org>
parents:
31119
diff
changeset
|
2142 && wlv.col |
30273
5f112a0b4da1
patch 9.0.0472: virtual text "below" doesn't show in list mode
Bram Moolenaar <Bram@vim.org>
parents:
30233
diff
changeset
|
2143 + wlv.n_extra - 2 > wp->w_width) |
5f112a0b4da1
patch 9.0.0472: virtual text "below" doesn't show in list mode
Bram Moolenaar <Bram@vim.org>
parents:
30233
diff
changeset
|
2144 // don't bail out at end of line |
30777
8f25424b4bfd
patch 9.0.0723: extra empty line below virtual text when 'list' is set
Bram Moolenaar <Bram@vim.org>
parents:
30775
diff
changeset
|
2145 text_prop_follows = TRUE; |
30273
5f112a0b4da1
patch 9.0.0472: virtual text "below" doesn't show in list mode
Bram Moolenaar <Bram@vim.org>
parents:
30233
diff
changeset
|
2146 |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2147 // When 'wrap' is off then for "below" we need |
30986
360f286b5869
patch 9.0.0828: various typos
Bram Moolenaar <Bram@vim.org>
parents:
30900
diff
changeset
|
2148 // to start a new line explicitly. |
29816
bbe62ea78aac
patch 9.0.0247: cannot add padding to virtual text without highlight
Bram Moolenaar <Bram@vim.org>
parents:
29808
diff
changeset
|
2149 if (start_line) |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2150 { |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2151 draw_screen_line(wp, &wlv); |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2152 |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2153 // When line got too long for screen break |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2154 // here. |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2155 if (wlv.row == endrow) |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2156 { |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2157 ++wlv.row; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2158 break; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2159 } |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2160 win_line_start(wp, &wlv, TRUE); |
30759
b41ccaa6fd84
patch 9.0.0714: with 'nowrap' two virtual text below not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
30749
diff
changeset
|
2161 bail_out = TRUE; |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2162 } |
29560
14b139cbec49
patch 9.0.0121: cannot put virtual text after or below a line
Bram Moolenaar <Bram@vim.org>
parents:
29550
diff
changeset
|
2163 } |
29451
057c26b5c33a
patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29413
diff
changeset
|
2164 } |
29560
14b139cbec49
patch 9.0.0121: cannot put virtual text after or below a line
Bram Moolenaar <Bram@vim.org>
parents:
29550
diff
changeset
|
2165 |
30763
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2166 // If the text didn't reach until the first window |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2167 // column we need to skip cells. |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2168 if (skip_cells > 0) |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2169 { |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2170 if (wlv.n_extra > skip_cells) |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2171 { |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2172 wlv.n_extra -= skip_cells; |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2173 wlv.p_extra += skip_cells; |
31323
a93392e93a53
patch 9.0.0995: padding before virtual text is highlighted
Bram Moolenaar <Bram@vim.org>
parents:
31315
diff
changeset
|
2174 wlv.n_attr_skip -= skip_cells; |
a93392e93a53
patch 9.0.0995: padding before virtual text is highlighted
Bram Moolenaar <Bram@vim.org>
parents:
31315
diff
changeset
|
2175 if (wlv.n_attr_skip < 0) |
a93392e93a53
patch 9.0.0995: padding before virtual text is highlighted
Bram Moolenaar <Bram@vim.org>
parents:
31315
diff
changeset
|
2176 wlv.n_attr_skip = 0; |
30763
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2177 skip_cells = 0; |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2178 } |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2179 else |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2180 { |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2181 // the whole text is left of the window, drop |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2182 // it and advance to the next one |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2183 skip_cells -= wlv.n_extra; |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2184 wlv.n_extra = 0; |
31323
a93392e93a53
patch 9.0.0995: padding before virtual text is highlighted
Bram Moolenaar <Bram@vim.org>
parents:
31315
diff
changeset
|
2185 wlv.n_attr_skip = 0; |
30763
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2186 bail_out = TRUE; |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2187 } |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2188 } |
8ea77a6ceff0
patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Bram Moolenaar <Bram@vim.org>
parents:
30759
diff
changeset
|
2189 |
29560
14b139cbec49
patch 9.0.0121: cannot put virtual text after or below a line
Bram Moolenaar <Bram@vim.org>
parents:
29550
diff
changeset
|
2190 // If another text prop follows the condition below at |
14b139cbec49
patch 9.0.0121: cannot put virtual text after or below a line
Bram Moolenaar <Bram@vim.org>
parents:
29550
diff
changeset
|
2191 // the last window column must know. |
30231
0d084880276a
patch 9.0.0451: virtual text "above" does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
30213
diff
changeset
|
2192 // If this is an "above" text prop and 'nowrap' the we |
0d084880276a
patch 9.0.0451: virtual text "above" does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
30213
diff
changeset
|
2193 // must wrap anyway. |
0d084880276a
patch 9.0.0451: virtual text "above" does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
30213
diff
changeset
|
2194 text_prop_above = above; |
30777
8f25424b4bfd
patch 9.0.0723: extra empty line below virtual text when 'list' is set
Bram Moolenaar <Bram@vim.org>
parents:
30775
diff
changeset
|
2195 text_prop_follows |= other_tpi != -1 |
31938
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
2196 && (wp->w_p_wrap |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
2197 || (text_props[other_tpi].tp_flags |
30749
6fe513996997
patch 9.0.0709: virtual text "after" not correct with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
30741
diff
changeset
|
2198 & (TP_FLAG_ALIGN_BELOW | TP_FLAG_ALIGN_RIGHT))); |
30759
b41ccaa6fd84
patch 9.0.0714: with 'nowrap' two virtual text below not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
30749
diff
changeset
|
2199 |
b41ccaa6fd84
patch 9.0.0714: with 'nowrap' two virtual text below not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
30749
diff
changeset
|
2200 if (bail_out) |
b41ccaa6fd84
patch 9.0.0714: with 'nowrap' two virtual text below not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
30749
diff
changeset
|
2201 // starting a new line for "below" |
b41ccaa6fd84
patch 9.0.0714: with 'nowrap' two virtual text below not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
30749
diff
changeset
|
2202 continue; |
29451
057c26b5c33a
patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29413
diff
changeset
|
2203 } |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2204 } |
29597
f2d7f20d83c3
patch 9.0.0139: truncating virtual text after a line not implemented
Bram Moolenaar <Bram@vim.org>
parents:
29583
diff
changeset
|
2205 else if (text_prop_next < text_prop_count |
f2d7f20d83c3
patch 9.0.0139: truncating virtual text after a line not implemented
Bram Moolenaar <Bram@vim.org>
parents:
29583
diff
changeset
|
2206 && text_props[text_prop_next].tp_col == MAXCOL |
29635
592818fd3110
patch 9.0.0158: with 'nowrap' "below" property not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
29633
diff
changeset
|
2207 && ((*ptr != NUL && ptr[mb_ptr2len(ptr)] == NUL) |
592818fd3110
patch 9.0.0158: with 'nowrap' "below" property not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
29633
diff
changeset
|
2208 || (!wp->w_p_wrap |
592818fd3110
patch 9.0.0158: with 'nowrap' "below" property not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
29633
diff
changeset
|
2209 && wlv.col == wp->w_width - 1 |
592818fd3110
patch 9.0.0158: with 'nowrap' "below" property not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
29633
diff
changeset
|
2210 && (text_props[text_prop_next].tp_flags |
592818fd3110
patch 9.0.0158: with 'nowrap' "below" property not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
29633
diff
changeset
|
2211 & TP_FLAG_ALIGN_BELOW)))) |
29597
f2d7f20d83c3
patch 9.0.0139: truncating virtual text after a line not implemented
Bram Moolenaar <Bram@vim.org>
parents:
29583
diff
changeset
|
2212 // When at last-but-one character and a text property |
f2d7f20d83c3
patch 9.0.0139: truncating virtual text after a line not implemented
Bram Moolenaar <Bram@vim.org>
parents:
29583
diff
changeset
|
2213 // follows after it, we may need to flush the line after |
f2d7f20d83c3
patch 9.0.0139: truncating virtual text after a line not implemented
Bram Moolenaar <Bram@vim.org>
parents:
29583
diff
changeset
|
2214 // displaying that character. |
29635
592818fd3110
patch 9.0.0158: with 'nowrap' "below" property not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
29633
diff
changeset
|
2215 // Or when not wrapping and at the rightmost column. |
29597
f2d7f20d83c3
patch 9.0.0139: truncating virtual text after a line not implemented
Bram Moolenaar <Bram@vim.org>
parents:
29583
diff
changeset
|
2216 text_prop_follows = TRUE; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2217 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2218 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2219 |
29706
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2220 #ifdef FEAT_SEARCH_EXTRA |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2221 if (wlv.n_extra == 0) |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2222 { |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2223 // Check for start/end of 'hlsearch' and other matches. |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2224 // After end, check for start/end of next match. |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2225 // When another match, have to check for start again. |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2226 v = (long)(ptr - line); |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2227 search_attr = update_search_hl(wp, lnum, (colnr_T)v, &line, |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2228 &screen_search_hl, &has_match_conc, |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2229 &match_conc, did_line_attr, lcs_eol_one, |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2230 &on_last_col); |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2231 ptr = line + v; // "line" may have been changed |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2232 prev_ptr = ptr; |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2233 |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2234 // Do not allow a conceal over EOL otherwise EOL will be missed |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2235 // and bad things happen. |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2236 if (*ptr == NUL) |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2237 has_match_conc = 0; |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2238 } |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2239 #endif |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2240 |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2241 #ifdef FEAT_DIFF |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2242 if (wlv.diff_hlf != (hlf_T)0) |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2243 { |
31469
c097c18dcedb
patch 9.0.1067: in diff mode virtual text is highlighted incorrectly
Bram Moolenaar <Bram@vim.org>
parents:
31431
diff
changeset
|
2244 // When there is extra text (e.g. virtual text) it gets the |
c097c18dcedb
patch 9.0.1067: in diff mode virtual text is highlighted incorrectly
Bram Moolenaar <Bram@vim.org>
parents:
31431
diff
changeset
|
2245 // diff highlighting for the line, but not for changed text. |
29706
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2246 if (wlv.diff_hlf == HLF_CHD && ptr - line >= change_start |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2247 && wlv.n_extra == 0) |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2248 wlv.diff_hlf = HLF_TXD; // changed text |
31473
edd37b53405a
patch 9.0.1069: diff mode highlight fails for special characters
Bram Moolenaar <Bram@vim.org>
parents:
31469
diff
changeset
|
2249 if (wlv.diff_hlf == HLF_TXD |
edd37b53405a
patch 9.0.1069: diff mode highlight fails for special characters
Bram Moolenaar <Bram@vim.org>
parents:
31469
diff
changeset
|
2250 && ((ptr - line > change_end && wlv.n_extra == 0) |
edd37b53405a
patch 9.0.1069: diff mode highlight fails for special characters
Bram Moolenaar <Bram@vim.org>
parents:
31469
diff
changeset
|
2251 || (wlv.n_extra > 0 && wlv.extra_for_textprop))) |
29706
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2252 wlv.diff_hlf = HLF_CHD; // changed line |
31297
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
2253 wlv.line_attr = HL_ATTR(wlv.diff_hlf); |
29706
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2254 if (wp->w_p_cul && lnum == wp->w_cursor.lnum |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2255 && wp->w_p_culopt_flags != CULOPT_NBR |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2256 && (!wlv.cul_screenline || (wlv.vcol >= left_curline_col |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2257 && wlv.vcol <= right_curline_col))) |
31297
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
2258 wlv.line_attr = hl_combine_attr( |
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
2259 wlv.line_attr, HL_ATTR(HLF_CUL)); |
29706
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2260 } |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2261 #endif |
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2262 |
18374
86c00b8fefea
patch 8.1.2181: highlighting wrong when item follows tab
Bram Moolenaar <Bram@vim.org>
parents:
18364
diff
changeset
|
2263 #ifdef FEAT_SYN_HL |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2264 if (extra_check && wlv.n_extra == 0) |
18317
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2265 { |
18390
c34ee31d0878
patch 8.1.2189: syntax highlighting wrong for tab
Bram Moolenaar <Bram@vim.org>
parents:
18374
diff
changeset
|
2266 syntax_attr = 0; |
18374
86c00b8fefea
patch 8.1.2181: highlighting wrong when item follows tab
Bram Moolenaar <Bram@vim.org>
parents:
18364
diff
changeset
|
2267 # ifdef FEAT_TERMINAL |
18317
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2268 if (get_term_attr) |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2269 syntax_attr = term_get_attr(wp, lnum, wlv.vcol); |
18374
86c00b8fefea
patch 8.1.2181: highlighting wrong when item follows tab
Bram Moolenaar <Bram@vim.org>
parents:
18364
diff
changeset
|
2270 # endif |
18317
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2271 // Get syntax attribute. |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2272 if (has_syntax) |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2273 { |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2274 // Get the syntax attribute for the character. If there |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2275 // is an error, disable syntax highlighting. |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2276 save_did_emsg = did_emsg; |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2277 did_emsg = FALSE; |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2278 |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2279 v = (long)(ptr - line); |
18323
72a0dbe1c004
patch 8.1.2156: first character after Tab is not highlighted
Bram Moolenaar <Bram@vim.org>
parents:
18321
diff
changeset
|
2280 if (v == prev_syntax_col) |
72a0dbe1c004
patch 8.1.2156: first character after Tab is not highlighted
Bram Moolenaar <Bram@vim.org>
parents:
18321
diff
changeset
|
2281 // at same column again |
72a0dbe1c004
patch 8.1.2156: first character after Tab is not highlighted
Bram Moolenaar <Bram@vim.org>
parents:
18321
diff
changeset
|
2282 syntax_attr = prev_syntax_attr; |
72a0dbe1c004
patch 8.1.2156: first character after Tab is not highlighted
Bram Moolenaar <Bram@vim.org>
parents:
18321
diff
changeset
|
2283 else |
72a0dbe1c004
patch 8.1.2156: first character after Tab is not highlighted
Bram Moolenaar <Bram@vim.org>
parents:
18321
diff
changeset
|
2284 { |
18337
b08dbcb42399
patch 8.1.2163: cannot build with +spell but without +syntax
Bram Moolenaar <Bram@vim.org>
parents:
18331
diff
changeset
|
2285 # ifdef FEAT_SPELL |
18323
72a0dbe1c004
patch 8.1.2156: first character after Tab is not highlighted
Bram Moolenaar <Bram@vim.org>
parents:
18321
diff
changeset
|
2286 can_spell = TRUE; |
18337
b08dbcb42399
patch 8.1.2163: cannot build with +spell but without +syntax
Bram Moolenaar <Bram@vim.org>
parents:
18331
diff
changeset
|
2287 # endif |
18323
72a0dbe1c004
patch 8.1.2156: first character after Tab is not highlighted
Bram Moolenaar <Bram@vim.org>
parents:
18321
diff
changeset
|
2288 syntax_attr = get_syntax_attr((colnr_T)v, |
18317
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2289 # ifdef FEAT_SPELL |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2290 has_spell ? &can_spell : |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2291 # endif |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2292 NULL, FALSE); |
18323
72a0dbe1c004
patch 8.1.2156: first character after Tab is not highlighted
Bram Moolenaar <Bram@vim.org>
parents:
18321
diff
changeset
|
2293 prev_syntax_col = v; |
72a0dbe1c004
patch 8.1.2156: first character after Tab is not highlighted
Bram Moolenaar <Bram@vim.org>
parents:
18321
diff
changeset
|
2294 prev_syntax_attr = syntax_attr; |
72a0dbe1c004
patch 8.1.2156: first character after Tab is not highlighted
Bram Moolenaar <Bram@vim.org>
parents:
18321
diff
changeset
|
2295 } |
18317
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2296 |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2297 if (did_emsg) |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2298 { |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2299 wp->w_s->b_syn_error = TRUE; |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2300 has_syntax = FALSE; |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2301 syntax_attr = 0; |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2302 } |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2303 else |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2304 did_emsg = save_did_emsg; |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2305 # ifdef SYN_TIME_LIMIT |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2306 if (wp->w_s->b_syn_slow) |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2307 has_syntax = FALSE; |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2308 # endif |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2309 |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2310 // Need to get the line again, a multi-line regexp may |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2311 // have made it invalid. |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2312 line = ml_get_buf(wp->w_buffer, lnum, FALSE); |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2313 ptr = line + v; |
29413
34e93e046526
patch 9.0.0048: cursor in wrong column with mouse click after concealed text
Bram Moolenaar <Bram@vim.org>
parents:
29387
diff
changeset
|
2314 prev_ptr = ptr; |
18317
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2315 # ifdef FEAT_CONCEAL |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2316 // no concealing past the end of the line, it interferes |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2317 // with line highlighting |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2318 if (*ptr == NUL) |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2319 syntax_flags = 0; |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2320 else |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2321 syntax_flags = get_syntax_info(&syntax_seqnr); |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2322 # endif |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2323 } |
18374
86c00b8fefea
patch 8.1.2181: highlighting wrong when item follows tab
Bram Moolenaar <Bram@vim.org>
parents:
18364
diff
changeset
|
2324 } |
18763
49b78d6465e5
patch 8.1.2371: FEAT_TEXT_PROP is a confusing name
Bram Moolenaar <Bram@vim.org>
parents:
18720
diff
changeset
|
2325 # ifdef FEAT_PROP_POPUP |
18570
0ac88fdbf089
patch 8.1.2279: computation of highlight attributes is too complicated
Bram Moolenaar <Bram@vim.org>
parents:
18502
diff
changeset
|
2326 // Combine text property highlight into syntax highlight. |
0ac88fdbf089
patch 8.1.2279: computation of highlight attributes is too complicated
Bram Moolenaar <Bram@vim.org>
parents:
18502
diff
changeset
|
2327 if (text_prop_type != NULL) |
0ac88fdbf089
patch 8.1.2279: computation of highlight attributes is too complicated
Bram Moolenaar <Bram@vim.org>
parents:
18502
diff
changeset
|
2328 { |
29611
608d5221a3e5
patch 9.0.0146: missing part of change for "override" flag
Bram Moolenaar <Bram@vim.org>
parents:
29597
diff
changeset
|
2329 if (text_prop_flags & PT_FLAG_COMBINE) |
18570
0ac88fdbf089
patch 8.1.2279: computation of highlight attributes is too complicated
Bram Moolenaar <Bram@vim.org>
parents:
18502
diff
changeset
|
2330 syntax_attr = hl_combine_attr(syntax_attr, text_prop_attr); |
0ac88fdbf089
patch 8.1.2279: computation of highlight attributes is too complicated
Bram Moolenaar <Bram@vim.org>
parents:
18502
diff
changeset
|
2331 else |
0ac88fdbf089
patch 8.1.2279: computation of highlight attributes is too complicated
Bram Moolenaar <Bram@vim.org>
parents:
18502
diff
changeset
|
2332 syntax_attr = text_prop_attr; |
30039
4b9b237d1211
patch 9.0.0357: 'linebreak' interferes with text property highlight
Bram Moolenaar <Bram@vim.org>
parents:
29918
diff
changeset
|
2333 text_prop_attr_comb = syntax_attr; |
18570
0ac88fdbf089
patch 8.1.2279: computation of highlight attributes is too complicated
Bram Moolenaar <Bram@vim.org>
parents:
18502
diff
changeset
|
2334 } |
0ac88fdbf089
patch 8.1.2279: computation of highlight attributes is too complicated
Bram Moolenaar <Bram@vim.org>
parents:
18502
diff
changeset
|
2335 # endif |
18317
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2336 #endif |
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2337 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2338 // Decide which of the highlight attributes to use. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2339 attr_pri = TRUE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2340 #ifdef LINE_ATTR |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2341 if (area_attr != 0) |
18364
ee489bb09ea8
patch 8.1.2176: syntax attributes not combined with Visual highlighting
Bram Moolenaar <Bram@vim.org>
parents:
18356
diff
changeset
|
2342 { |
31297
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
2343 wlv.char_attr = hl_combine_attr(wlv.line_attr, area_attr); |
24514
e3efa11b6a1e
patch 8.2.2797: Search highlight disappears in the Visual area
Bram Moolenaar <Bram@vim.org>
parents:
24071
diff
changeset
|
2344 if (!highlight_match) |
e3efa11b6a1e
patch 8.2.2797: Search highlight disappears in the Visual area
Bram Moolenaar <Bram@vim.org>
parents:
24071
diff
changeset
|
2345 // let search highlight show in Visual area if possible |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2346 wlv.char_attr = hl_combine_attr(search_attr, wlv.char_attr); |
18364
ee489bb09ea8
patch 8.1.2176: syntax attributes not combined with Visual highlighting
Bram Moolenaar <Bram@vim.org>
parents:
18356
diff
changeset
|
2347 # ifdef FEAT_SYN_HL |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2348 wlv.char_attr = hl_combine_attr(syntax_attr, wlv.char_attr); |
18364
ee489bb09ea8
patch 8.1.2176: syntax attributes not combined with Visual highlighting
Bram Moolenaar <Bram@vim.org>
parents:
18356
diff
changeset
|
2349 # endif |
ee489bb09ea8
patch 8.1.2176: syntax attributes not combined with Visual highlighting
Bram Moolenaar <Bram@vim.org>
parents:
18356
diff
changeset
|
2350 } |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2351 else if (search_attr != 0) |
18364
ee489bb09ea8
patch 8.1.2176: syntax attributes not combined with Visual highlighting
Bram Moolenaar <Bram@vim.org>
parents:
18356
diff
changeset
|
2352 { |
31297
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
2353 wlv.char_attr = hl_combine_attr(wlv.line_attr, search_attr); |
18364
ee489bb09ea8
patch 8.1.2176: syntax attributes not combined with Visual highlighting
Bram Moolenaar <Bram@vim.org>
parents:
18356
diff
changeset
|
2354 # ifdef FEAT_SYN_HL |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2355 wlv.char_attr = hl_combine_attr(syntax_attr, wlv.char_attr); |
18364
ee489bb09ea8
patch 8.1.2176: syntax attributes not combined with Visual highlighting
Bram Moolenaar <Bram@vim.org>
parents:
18356
diff
changeset
|
2356 # endif |
ee489bb09ea8
patch 8.1.2176: syntax attributes not combined with Visual highlighting
Bram Moolenaar <Bram@vim.org>
parents:
18356
diff
changeset
|
2357 } |
31297
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
2358 else if (wlv.line_attr != 0 |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
2359 && ((wlv.fromcol == -10 && wlv.tocol == MAXCOL) |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
2360 || wlv.vcol < wlv.fromcol |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
2361 || vcol_prev < fromcol_prev |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
2362 || wlv.vcol >= wlv.tocol)) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2363 { |
31297
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
2364 // Use wlv.line_attr when not in the Visual or 'incsearch' area |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2365 // (area_attr may be 0 when "noinvcur" is set). |
18317
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2366 # ifdef FEAT_SYN_HL |
31297
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
2367 wlv.char_attr = hl_combine_attr(syntax_attr, wlv.line_attr); |
18570
0ac88fdbf089
patch 8.1.2279: computation of highlight attributes is too complicated
Bram Moolenaar <Bram@vim.org>
parents:
18502
diff
changeset
|
2368 # else |
31297
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
2369 wlv.char_attr = wlv.line_attr; |
18317
d2228d4cf1f6
patch 8.1.2153: combining text property and syntax highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
2370 # endif |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2371 attr_pri = FALSE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2372 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2373 #else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2374 if (area_attr != 0) |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2375 wlv.char_attr = area_attr; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2376 else if (search_attr != 0) |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2377 wlv.char_attr = search_attr; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2378 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2379 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2380 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2381 attr_pri = FALSE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2382 #ifdef FEAT_SYN_HL |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2383 wlv.char_attr = syntax_attr; |
18374
86c00b8fefea
patch 8.1.2181: highlighting wrong when item follows tab
Bram Moolenaar <Bram@vim.org>
parents:
18364
diff
changeset
|
2384 #else |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2385 wlv.char_attr = 0; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2386 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2387 } |
29611
608d5221a3e5
patch 9.0.0146: missing part of change for "override" flag
Bram Moolenaar <Bram@vim.org>
parents:
29597
diff
changeset
|
2388 #ifdef FEAT_PROP_POPUP |
608d5221a3e5
patch 9.0.0146: missing part of change for "override" flag
Bram Moolenaar <Bram@vim.org>
parents:
29597
diff
changeset
|
2389 // override with text property highlight when "override" is TRUE |
608d5221a3e5
patch 9.0.0146: missing part of change for "override" flag
Bram Moolenaar <Bram@vim.org>
parents:
29597
diff
changeset
|
2390 if (text_prop_type != NULL && (text_prop_flags & PT_FLAG_OVERRIDE)) |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2391 wlv.char_attr = hl_combine_attr(wlv.char_attr, text_prop_attr); |
29611
608d5221a3e5
patch 9.0.0146: missing part of change for "override" flag
Bram Moolenaar <Bram@vim.org>
parents:
29597
diff
changeset
|
2392 #endif |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2393 } |
18494
04a40c1514c4
patch 8.1.2241: match highlight does not combine with 'wincolor'
Bram Moolenaar <Bram@vim.org>
parents:
18471
diff
changeset
|
2394 |
04a40c1514c4
patch 8.1.2241: match highlight does not combine with 'wincolor'
Bram Moolenaar <Bram@vim.org>
parents:
18471
diff
changeset
|
2395 // combine attribute with 'wincolor' |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2396 if (wlv.win_attr != 0) |
18494
04a40c1514c4
patch 8.1.2241: match highlight does not combine with 'wincolor'
Bram Moolenaar <Bram@vim.org>
parents:
18471
diff
changeset
|
2397 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2398 if (wlv.char_attr == 0) |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2399 wlv.char_attr = wlv.win_attr; |
18494
04a40c1514c4
patch 8.1.2241: match highlight does not combine with 'wincolor'
Bram Moolenaar <Bram@vim.org>
parents:
18471
diff
changeset
|
2400 else |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2401 wlv.char_attr = hl_combine_attr(wlv.win_attr, wlv.char_attr); |
18494
04a40c1514c4
patch 8.1.2241: match highlight does not combine with 'wincolor'
Bram Moolenaar <Bram@vim.org>
parents:
18471
diff
changeset
|
2402 } |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2403 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2404 // Get the next character to put on the screen. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2405 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2406 // The "p_extra" points to the extra stuff that is inserted to |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2407 // represent special characters (non-printable stuff) and other |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2408 // things. When all characters are the same, c_extra is used. |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2409 // If wlv.c_final is set, it will compulsorily be used at the end. |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2410 // "p_extra" must end in a NUL to avoid mb_ptr2len() reads past |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2411 // "p_extra[n_extra]". |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2412 // For the '$' of the 'list' option, n_extra == 1, p_extra == "". |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2413 if (wlv.n_extra > 0) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2414 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2415 if (wlv.c_extra != NUL || (wlv.n_extra == 1 && wlv.c_final != NUL)) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2416 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2417 c = (wlv.n_extra == 1 && wlv.c_final != NUL) |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2418 ? wlv.c_final : wlv.c_extra; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2419 mb_c = c; // doesn't handle non-utf-8 multi-byte! |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2420 if (enc_utf8 && utf_char2len(c) > 1) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2421 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2422 mb_utf8 = TRUE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2423 u8cc[0] = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2424 c = 0xc0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2425 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2426 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2427 mb_utf8 = FALSE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2428 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2429 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2430 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2431 c = *wlv.p_extra; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2432 if (has_mbyte) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2433 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2434 mb_c = c; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2435 if (enc_utf8) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2436 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2437 // If the UTF-8 character is more than one byte: |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2438 // Decode it into "mb_c". |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2439 mb_l = utfc_ptr2len(wlv.p_extra); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2440 mb_utf8 = FALSE; |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2441 if (mb_l > wlv.n_extra) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2442 mb_l = 1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2443 else if (mb_l > 1) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2444 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2445 mb_c = utfc_ptr2char(wlv.p_extra, u8cc); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2446 mb_utf8 = TRUE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2447 c = 0xc0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2448 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2449 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2450 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2451 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2452 // if this is a DBCS character, put it in "mb_c" |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2453 mb_l = MB_BYTE2LEN(c); |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2454 if (mb_l >= wlv.n_extra) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2455 mb_l = 1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2456 else if (mb_l > 1) |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2457 mb_c = (c << 8) + wlv.p_extra[1]; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2458 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2459 if (mb_l == 0) // at the NUL at end-of-line |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2460 mb_l = 1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2461 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2462 // If a double-width char doesn't fit display a '>' in the |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2463 // last column. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2464 if (( |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2465 # ifdef FEAT_RIGHTLEFT |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2466 wp->w_p_rl ? (wlv.col <= 0) : |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2467 # endif |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2468 (wlv.col >= wp->w_width - 1)) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2469 && (*mb_char2cells)(mb_c) == 2) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2470 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2471 c = '>'; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2472 mb_c = c; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2473 mb_l = 1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2474 mb_utf8 = FALSE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2475 multi_attr = HL_ATTR(HLF_AT); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2476 #ifdef FEAT_SYN_HL |
30395
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
2477 if (wlv.cul_attr) |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
2478 multi_attr = hl_combine_attr( |
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
2479 multi_attr, wlv.cul_attr); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2480 #endif |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2481 multi_attr = hl_combine_attr(wlv.win_attr, multi_attr); |
18720
7f066dff9d70
patch 8.1.2351: 'wincolor' not used for > for not fitting double width char
Bram Moolenaar <Bram@vim.org>
parents:
18603
diff
changeset
|
2482 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2483 // put the pointer back to output the double-width |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2484 // character at the start of the next line. |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2485 ++wlv.n_extra; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2486 --wlv.p_extra; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2487 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2488 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2489 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2490 wlv.n_extra -= mb_l - 1; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2491 wlv.p_extra += mb_l - 1; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2492 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2493 } |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2494 ++wlv.p_extra; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2495 } |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2496 --wlv.n_extra; |
29706
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2497 #if defined(FEAT_PROP_POPUP) |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2498 if (wlv.n_extra <= 0) |
29706
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2499 { |
31221
59de2172e99d
patch 9.0.0944: 'cursorline' causes virtual text highlight to continue
Bram Moolenaar <Bram@vim.org>
parents:
31142
diff
changeset
|
2500 // Only restore search_attr and area_attr after "n_extra" in |
59de2172e99d
patch 9.0.0944: 'cursorline' causes virtual text highlight to continue
Bram Moolenaar <Bram@vim.org>
parents:
31142
diff
changeset
|
2501 // the next screen line is also done. |
31113
6ff733178f8b
patch 9.0.0891: virtual text below after match has wrong highlight
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2502 if (wlv.saved_n_extra <= 0) |
6ff733178f8b
patch 9.0.0891: virtual text below after match has wrong highlight
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2503 { |
6ff733178f8b
patch 9.0.0891: virtual text below after match has wrong highlight
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2504 if (search_attr == 0) |
6ff733178f8b
patch 9.0.0891: virtual text below after match has wrong highlight
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2505 search_attr = saved_search_attr; |
6ff733178f8b
patch 9.0.0891: virtual text below after match has wrong highlight
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2506 if (area_attr == 0 && *ptr != NUL) |
6ff733178f8b
patch 9.0.0891: virtual text below after match has wrong highlight
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2507 area_attr = saved_area_attr; |
31223
30377fd8341e
patch 9.0.0945: failures in the cursorline test
Bram Moolenaar <Bram@vim.org>
parents:
31221
diff
changeset
|
2508 |
30377fd8341e
patch 9.0.0945: failures in the cursorline test
Bram Moolenaar <Bram@vim.org>
parents:
31221
diff
changeset
|
2509 if (wlv.extra_for_textprop) |
30377fd8341e
patch 9.0.0945: failures in the cursorline test
Bram Moolenaar <Bram@vim.org>
parents:
31221
diff
changeset
|
2510 // wlv.extra_attr should be used at this position but |
30377fd8341e
patch 9.0.0945: failures in the cursorline test
Bram Moolenaar <Bram@vim.org>
parents:
31221
diff
changeset
|
2511 // not any further. |
30377fd8341e
patch 9.0.0945: failures in the cursorline test
Bram Moolenaar <Bram@vim.org>
parents:
31221
diff
changeset
|
2512 reset_extra_attr = TRUE; |
31113
6ff733178f8b
patch 9.0.0891: virtual text below after match has wrong highlight
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2513 } |
31223
30377fd8341e
patch 9.0.0945: failures in the cursorline test
Bram Moolenaar <Bram@vim.org>
parents:
31221
diff
changeset
|
2514 |
30377fd8341e
patch 9.0.0945: failures in the cursorline test
Bram Moolenaar <Bram@vim.org>
parents:
31221
diff
changeset
|
2515 wlv.extra_for_textprop = FALSE; |
30377fd8341e
patch 9.0.0945: failures in the cursorline test
Bram Moolenaar <Bram@vim.org>
parents:
31221
diff
changeset
|
2516 in_linebreak = FALSE; |
29706
a680dc1b089d
patch 9.0.0193: search and match highlgith interfere with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29698
diff
changeset
|
2517 } |
26338
4cf208415483
patch 8.2.3700: text property highlighting continues over breakindent
Bram Moolenaar <Bram@vim.org>
parents:
26334
diff
changeset
|
2518 #endif |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2519 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2520 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2521 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2522 #ifdef FEAT_LINEBREAK |
29413
34e93e046526
patch 9.0.0048: cursor in wrong column with mouse click after concealed text
Bram Moolenaar <Bram@vim.org>
parents:
29387
diff
changeset
|
2523 int c0; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2524 #endif |
29413
34e93e046526
patch 9.0.0048: cursor in wrong column with mouse click after concealed text
Bram Moolenaar <Bram@vim.org>
parents:
29387
diff
changeset
|
2525 prev_ptr = ptr; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2526 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2527 // Get a character from the line itself. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2528 c = *ptr; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2529 #ifdef FEAT_LINEBREAK |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2530 c0 = *ptr; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2531 #endif |
31938
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
2532 #ifdef FEAT_PROP_POPUP |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
2533 if (c == NUL) |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
2534 // text is finished, may display a "below" virtual text |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
2535 did_line = TRUE; |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
2536 #endif |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
2537 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2538 if (has_mbyte) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2539 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2540 mb_c = c; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2541 if (enc_utf8) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2542 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2543 // If the UTF-8 character is more than one byte: Decode it |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2544 // into "mb_c". |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2545 mb_l = utfc_ptr2len(ptr); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2546 mb_utf8 = FALSE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2547 if (mb_l > 1) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2548 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2549 mb_c = utfc_ptr2char(ptr, u8cc); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2550 // Overlong encoded ASCII or ASCII with composing char |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2551 // is displayed normally, except a NUL. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2552 if (mb_c < 0x80) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2553 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2554 c = mb_c; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2555 #ifdef FEAT_LINEBREAK |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2556 c0 = mb_c; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2557 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2558 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2559 mb_utf8 = TRUE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2560 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2561 // At start of the line we can have a composing char. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2562 // Draw it as a space with a composing char. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2563 if (utf_iscomposing(mb_c)) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2564 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2565 int i; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2566 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2567 for (i = Screen_mco - 1; i > 0; --i) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2568 u8cc[i] = u8cc[i - 1]; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2569 u8cc[0] = mb_c; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2570 mb_c = ' '; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2571 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2572 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2573 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2574 if ((mb_l == 1 && c >= 0x80) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2575 || (mb_l >= 1 && mb_c == 0) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2576 || (mb_l > 1 && (!vim_isprintc(mb_c)))) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2577 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2578 // Illegal UTF-8 byte: display as <xx>. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2579 // Non-BMP character : display as ? or fullwidth ?. |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
2580 transchar_hex(wlv.extra, mb_c); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2581 # ifdef FEAT_RIGHTLEFT |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2582 if (wp->w_p_rl) // reverse |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
2583 rl_mirror(wlv.extra); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2584 # endif |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
2585 wlv.p_extra = wlv.extra; |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2586 c = *wlv.p_extra; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2587 mb_c = mb_ptr2char_adv(&wlv.p_extra); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2588 mb_utf8 = (c >= 0x80); |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2589 wlv.n_extra = (int)STRLEN(wlv.p_extra); |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2590 wlv.c_extra = NUL; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2591 wlv.c_final = NUL; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2592 if (area_attr == 0 && search_attr == 0) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2593 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2594 n_attr = wlv.n_extra + 1; |
31113
6ff733178f8b
patch 9.0.0891: virtual text below after match has wrong highlight
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2595 wlv.extra_attr = hl_combine_attr( |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2596 wlv.win_attr, HL_ATTR(HLF_8)); |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2597 saved_attr2 = wlv.char_attr; // save current attr |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2598 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2599 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2600 else if (mb_l == 0) // at the NUL at end-of-line |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2601 mb_l = 1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2602 #ifdef FEAT_ARABIC |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2603 else if (p_arshape && !p_tbidi && ARABIC_CHAR(mb_c)) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2604 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2605 // Do Arabic shaping. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2606 int pc, pc1, nc; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2607 int pcc[MAX_MCO]; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2608 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2609 // The idea of what is the previous and next |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2610 // character depends on 'rightleft'. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2611 if (wp->w_p_rl) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2612 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2613 pc = prev_c; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2614 pc1 = prev_c1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2615 nc = utf_ptr2char(ptr + mb_l); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2616 prev_c1 = u8cc[0]; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2617 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2618 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2619 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2620 pc = utfc_ptr2char(ptr + mb_l, pcc); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2621 nc = prev_c; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2622 pc1 = pcc[0]; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2623 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2624 prev_c = mb_c; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2625 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2626 mb_c = arabic_shape(mb_c, &c, &u8cc[0], pc, pc1, nc); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2627 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2628 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2629 prev_c = mb_c; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2630 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2631 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2632 else // enc_dbcs |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2633 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2634 mb_l = MB_BYTE2LEN(c); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2635 if (mb_l == 0) // at the NUL at end-of-line |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2636 mb_l = 1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2637 else if (mb_l > 1) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2638 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2639 // We assume a second byte below 32 is illegal. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2640 // Hopefully this is OK for all double-byte encodings! |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2641 if (ptr[1] >= 32) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2642 mb_c = (c << 8) + ptr[1]; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2643 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2644 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2645 if (ptr[1] == NUL) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2646 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2647 // head byte at end of line |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2648 mb_l = 1; |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
2649 transchar_nonprint(wp->w_buffer, wlv.extra, c); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2650 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2651 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2652 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2653 // illegal tail byte |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2654 mb_l = 2; |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
2655 STRCPY(wlv.extra, "XX"); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2656 } |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
2657 wlv.p_extra = wlv.extra; |
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
2658 wlv.n_extra = (int)STRLEN(wlv.extra) - 1; |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2659 wlv.c_extra = NUL; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2660 wlv.c_final = NUL; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2661 c = *wlv.p_extra++; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2662 if (area_attr == 0 && search_attr == 0) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2663 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2664 n_attr = wlv.n_extra + 1; |
31113
6ff733178f8b
patch 9.0.0891: virtual text below after match has wrong highlight
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2665 wlv.extra_attr = hl_combine_attr( |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2666 wlv.win_attr, HL_ATTR(HLF_8)); |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2667 // save current attr |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2668 saved_attr2 = wlv.char_attr; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2669 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2670 mb_c = c; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2671 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2672 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2673 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2674 // If a double-width char doesn't fit display a '>' in the |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2675 // last column; the character is displayed at the start of the |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2676 // next line. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2677 if (( |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2678 # ifdef FEAT_RIGHTLEFT |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2679 wp->w_p_rl ? (wlv.col <= 0) : |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2680 # endif |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2681 (wlv.col >= wp->w_width - 1)) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2682 && (*mb_char2cells)(mb_c) == 2) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2683 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2684 c = '>'; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2685 mb_c = c; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2686 mb_utf8 = FALSE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2687 mb_l = 1; |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2688 multi_attr = hl_combine_attr(wlv.win_attr, HL_ATTR(HLF_AT)); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2689 // Put pointer back so that the character will be |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2690 // displayed at the start of the next line. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2691 --ptr; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2692 #ifdef FEAT_CONCEAL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2693 did_decrement_ptr = TRUE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2694 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2695 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2696 else if (*ptr != NUL) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2697 ptr += mb_l - 1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2698 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2699 // If a double-width char doesn't fit at the left side display |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2700 // a '<' in the first column. Don't do this for unprintable |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2701 // characters. |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2702 if (n_skip > 0 && mb_l > 1 && wlv.n_extra == 0) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2703 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2704 wlv.n_extra = 1; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2705 wlv.c_extra = MB_FILLER_CHAR; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2706 wlv.c_final = NUL; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2707 c = ' '; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2708 if (area_attr == 0 && search_attr == 0) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2709 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2710 n_attr = wlv.n_extra + 1; |
31113
6ff733178f8b
patch 9.0.0891: virtual text below after match has wrong highlight
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2711 wlv.extra_attr = hl_combine_attr( |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2712 wlv.win_attr, HL_ATTR(HLF_AT)); |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2713 saved_attr2 = wlv.char_attr; // save current attr |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2714 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2715 mb_c = c; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2716 mb_utf8 = FALSE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2717 mb_l = 1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2718 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2719 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2720 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2721 ++ptr; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2722 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2723 if (extra_check) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2724 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2725 #ifdef FEAT_SPELL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2726 // Check spelling (unless at the end of the line). |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2727 // Only do this when there is no syntax highlighting, the |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2728 // @Spell cluster is not used or the current syntax item |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2729 // contains the @Spell cluster. |
18356
596a04c49d76
patch 8.1.2172: spell highlight is wrong at start of the line
Bram Moolenaar <Bram@vim.org>
parents:
18337
diff
changeset
|
2730 v = (long)(ptr - line); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2731 if (has_spell && v >= word_end && v > cur_checked_col) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2732 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2733 spell_attr = 0; |
29670
addac7a2d951
patch 9.0.0175: spell checking for capital not working with trailing space
Bram Moolenaar <Bram@vim.org>
parents:
29662
diff
changeset
|
2734 // do not calculate cap_col at the end of the line or when |
addac7a2d951
patch 9.0.0175: spell checking for capital not working with trailing space
Bram Moolenaar <Bram@vim.org>
parents:
29662
diff
changeset
|
2735 // only white space is following |
addac7a2d951
patch 9.0.0175: spell checking for capital not working with trailing space
Bram Moolenaar <Bram@vim.org>
parents:
29662
diff
changeset
|
2736 if (c != 0 && (*skipwhite(prev_ptr) != NUL) && ( |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2737 # ifdef FEAT_SYN_HL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2738 !has_syntax || |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2739 # endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2740 can_spell)) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2741 { |
29413
34e93e046526
patch 9.0.0048: cursor in wrong column with mouse click after concealed text
Bram Moolenaar <Bram@vim.org>
parents:
29387
diff
changeset
|
2742 char_u *p; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2743 int len; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2744 hlf_T spell_hlf = HLF_COUNT; |
22818
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
22280
diff
changeset
|
2745 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2746 if (has_mbyte) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2747 v -= mb_l - 1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2748 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2749 // Use nextline[] if possible, it has the start of the |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2750 // next line concatenated. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2751 if ((prev_ptr - line) - nextlinecol >= 0) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2752 p = nextline + (prev_ptr - line) - nextlinecol; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2753 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2754 p = prev_ptr; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2755 cap_col -= (int)(prev_ptr - line); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2756 len = spell_check(wp, p, &spell_hlf, &cap_col, |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2757 nochange); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2758 word_end = v + len; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2759 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2760 // In Insert mode only highlight a word that |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2761 // doesn't touch the cursor. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2762 if (spell_hlf != HLF_COUNT |
28773
d770568e6c98
patch 8.2.4911: the mode #defines are not clearly named
Bram Moolenaar <Bram@vim.org>
parents:
28177
diff
changeset
|
2763 && (State & MODE_INSERT) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2764 && wp->w_cursor.lnum == lnum |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2765 && wp->w_cursor.col >= |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2766 (colnr_T)(prev_ptr - line) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2767 && wp->w_cursor.col < (colnr_T)word_end) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2768 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2769 spell_hlf = HLF_COUNT; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2770 spell_redraw_lnum = lnum; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2771 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2772 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2773 if (spell_hlf == HLF_COUNT && p != prev_ptr |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2774 && (p - nextline) + len > nextline_idx) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2775 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2776 // Remember that the good word continues at the |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2777 // start of the next line. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2778 checked_lnum = lnum + 1; |
18356
596a04c49d76
patch 8.1.2172: spell highlight is wrong at start of the line
Bram Moolenaar <Bram@vim.org>
parents:
18337
diff
changeset
|
2779 checked_col = (int)((p - nextline) |
596a04c49d76
patch 8.1.2172: spell highlight is wrong at start of the line
Bram Moolenaar <Bram@vim.org>
parents:
18337
diff
changeset
|
2780 + len - nextline_idx); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2781 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2782 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2783 // Turn index into actual attributes. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2784 if (spell_hlf != HLF_COUNT) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2785 spell_attr = highlight_attr[spell_hlf]; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2786 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2787 if (cap_col > 0) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2788 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2789 if (p != prev_ptr |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2790 && (p - nextline) + cap_col >= nextline_idx) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2791 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2792 // Remember that the word in the next line |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2793 // must start with a capital. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2794 capcol_lnum = lnum + 1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2795 cap_col = (int)((p - nextline) + cap_col |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2796 - nextline_idx); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2797 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2798 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2799 // Compute the actual column. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2800 cap_col += (int)(prev_ptr - line); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2801 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2802 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2803 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2804 if (spell_attr != 0) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2805 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2806 if (!attr_pri) |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2807 wlv.char_attr = hl_combine_attr(wlv.char_attr, |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2808 spell_attr); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2809 else |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2810 wlv.char_attr = hl_combine_attr(spell_attr, |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2811 wlv.char_attr); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2812 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2813 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2814 #ifdef FEAT_LINEBREAK |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2815 // Found last space before word: check for line break. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2816 if (wp->w_p_lbr && c0 == c |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2817 && VIM_ISBREAK(c) && !VIM_ISBREAK((int)*ptr)) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2818 { |
25711
d1457c3f156c
patch 8.2.3391: crash with combination of 'linebreak' and other options
Bram Moolenaar <Bram@vim.org>
parents:
25517
diff
changeset
|
2819 int mb_off = has_mbyte ? (*mb_head_off)(line, ptr - 1) |
d1457c3f156c
patch 8.2.3391: crash with combination of 'linebreak' and other options
Bram Moolenaar <Bram@vim.org>
parents:
25517
diff
changeset
|
2820 : 0; |
d1457c3f156c
patch 8.2.3391: crash with combination of 'linebreak' and other options
Bram Moolenaar <Bram@vim.org>
parents:
25517
diff
changeset
|
2821 char_u *p = ptr - (mb_off + 1); |
29451
057c26b5c33a
patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29413
diff
changeset
|
2822 chartabsize_T cts; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2823 |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2824 init_chartabsize_arg(&cts, wp, lnum, wlv.vcol, line, p); |
29686
4153e4815b36
patch 9.0.0183: extra space after virtual text when 'linebreak' is set
Bram Moolenaar <Bram@vim.org>
parents:
29670
diff
changeset
|
2825 # ifdef FEAT_PROP_POPUP |
4153e4815b36
patch 9.0.0183: extra space after virtual text when 'linebreak' is set
Bram Moolenaar <Bram@vim.org>
parents:
29670
diff
changeset
|
2826 // do not want virtual text counted here |
4153e4815b36
patch 9.0.0183: extra space after virtual text when 'linebreak' is set
Bram Moolenaar <Bram@vim.org>
parents:
29670
diff
changeset
|
2827 cts.cts_has_prop_with_text = FALSE; |
4153e4815b36
patch 9.0.0183: extra space after virtual text when 'linebreak' is set
Bram Moolenaar <Bram@vim.org>
parents:
29670
diff
changeset
|
2828 # endif |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2829 wlv.n_extra = win_lbr_chartabsize(&cts, NULL) - 1; |
29686
4153e4815b36
patch 9.0.0183: extra space after virtual text when 'linebreak' is set
Bram Moolenaar <Bram@vim.org>
parents:
29670
diff
changeset
|
2830 clear_chartabsize_arg(&cts); |
24729
03492b62d79a
patch 8.2.2903: cursor position wrong on wrapped line with 'signcolumn'
Bram Moolenaar <Bram@vim.org>
parents:
24514
diff
changeset
|
2831 |
03492b62d79a
patch 8.2.2903: cursor position wrong on wrapped line with 'signcolumn'
Bram Moolenaar <Bram@vim.org>
parents:
24514
diff
changeset
|
2832 // We have just drawn the showbreak value, no need to add |
25711
d1457c3f156c
patch 8.2.3391: crash with combination of 'linebreak' and other options
Bram Moolenaar <Bram@vim.org>
parents:
25517
diff
changeset
|
2833 // space for it again. |
30395
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
2834 if (wlv.vcol == wlv.vcol_sbr) |
25711
d1457c3f156c
patch 8.2.3391: crash with combination of 'linebreak' and other options
Bram Moolenaar <Bram@vim.org>
parents:
25517
diff
changeset
|
2835 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2836 wlv.n_extra -= MB_CHARLEN(get_showbreak_value(wp)); |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2837 if (wlv.n_extra < 0) |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2838 wlv.n_extra = 0; |
25711
d1457c3f156c
patch 8.2.3391: crash with combination of 'linebreak' and other options
Bram Moolenaar <Bram@vim.org>
parents:
25517
diff
changeset
|
2839 } |
27067
89bc175b25a5
patch 8.2.4062: match highlighting of tab too short
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
2840 if (on_last_col && c != TAB) |
26334
baec4e1cee43
patch 8.2.3698: match highlighting continues over breakindent
Bram Moolenaar <Bram@vim.org>
parents:
26266
diff
changeset
|
2841 // Do not continue search/match highlighting over the |
27067
89bc175b25a5
patch 8.2.4062: match highlighting of tab too short
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
2842 // line break, but for TABs the highlighting should |
89bc175b25a5
patch 8.2.4062: match highlighting of tab too short
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
2843 // include the complete width of the character |
26334
baec4e1cee43
patch 8.2.3698: match highlighting continues over breakindent
Bram Moolenaar <Bram@vim.org>
parents:
26266
diff
changeset
|
2844 search_attr = 0; |
24729
03492b62d79a
patch 8.2.2903: cursor position wrong on wrapped line with 'signcolumn'
Bram Moolenaar <Bram@vim.org>
parents:
24514
diff
changeset
|
2845 |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2846 if (c == TAB && wlv.n_extra + wlv.col > wp->w_width) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2847 # ifdef FEAT_VARTABS |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2848 wlv.n_extra = tabstop_padding(wlv.vcol, |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2849 wp->w_buffer->b_p_ts, |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2850 wp->w_buffer->b_p_vts_array) - 1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2851 # else |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2852 wlv.n_extra = (int)wp->w_buffer->b_p_ts |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2853 - wlv.vcol % (int)wp->w_buffer->b_p_ts - 1; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2854 # endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2855 |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2856 wlv.c_extra = mb_off > 0 ? MB_FILLER_CHAR : ' '; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2857 wlv.c_final = NUL; |
29686
4153e4815b36
patch 9.0.0183: extra space after virtual text when 'linebreak' is set
Bram Moolenaar <Bram@vim.org>
parents:
29670
diff
changeset
|
2858 # ifdef FEAT_PROP_POPUP |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2859 if (wlv.n_extra > 0 && c != TAB) |
26338
4cf208415483
patch 8.2.3700: text property highlighting continues over breakindent
Bram Moolenaar <Bram@vim.org>
parents:
26334
diff
changeset
|
2860 in_linebreak = TRUE; |
26374
59f2b11ad1be
patch 8.2.3718: compiler warns for unused variable without +textprop
Bram Moolenaar <Bram@vim.org>
parents:
26350
diff
changeset
|
2861 # endif |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2862 if (VIM_ISWHITE(c)) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2863 { |
18773
38a3bef525e6
patch 8.1.2376: preprocessor indents are incorrect
Bram Moolenaar <Bram@vim.org>
parents:
18763
diff
changeset
|
2864 # ifdef FEAT_CONCEAL |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2865 if (c == TAB) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2866 // See "Tab alignment" below. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2867 FIX_FOR_BOGUSCOLS; |
18773
38a3bef525e6
patch 8.1.2376: preprocessor indents are incorrect
Bram Moolenaar <Bram@vim.org>
parents:
18763
diff
changeset
|
2868 # endif |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2869 if (!wp->w_p_list) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2870 c = ' '; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2871 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2872 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2873 #endif |
25778
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25749
diff
changeset
|
2874 in_multispace = c == ' ' |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25749
diff
changeset
|
2875 && ((ptr > line + 1 && ptr[-2] == ' ') || *ptr == ' '); |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25749
diff
changeset
|
2876 if (!in_multispace) |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25749
diff
changeset
|
2877 multispace_pos = 0; |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25749
diff
changeset
|
2878 |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23901
diff
changeset
|
2879 // 'list': Change char 160 to 'nbsp' and space to 'space' |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23901
diff
changeset
|
2880 // setting in 'listchars'. But not when the character is |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23901
diff
changeset
|
2881 // followed by a composing character (use mb_l to check that). |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2882 if (wp->w_p_list |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2883 && ((((c == 160 && mb_l == 1) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2884 || (mb_utf8 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2885 && ((mb_c == 160 && mb_l == 2) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2886 || (mb_c == 0x202f && mb_l == 3)))) |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23901
diff
changeset
|
2887 && wp->w_lcs_chars.nbsp) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2888 || (c == ' ' |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2889 && mb_l == 1 |
25778
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25749
diff
changeset
|
2890 && (wp->w_lcs_chars.space |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25749
diff
changeset
|
2891 || (in_multispace |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25749
diff
changeset
|
2892 && wp->w_lcs_chars.multispace != NULL)) |
23825
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
22997
diff
changeset
|
2893 && ptr - line >= leadcol |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2894 && ptr - line <= trailcol))) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2895 { |
25778
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25749
diff
changeset
|
2896 if (in_multispace && wp->w_lcs_chars.multispace != NULL) |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25749
diff
changeset
|
2897 { |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25749
diff
changeset
|
2898 c = wp->w_lcs_chars.multispace[multispace_pos++]; |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25749
diff
changeset
|
2899 if (wp->w_lcs_chars.multispace[multispace_pos] == NUL) |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25749
diff
changeset
|
2900 multispace_pos = 0; |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25749
diff
changeset
|
2901 } |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25749
diff
changeset
|
2902 else |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25749
diff
changeset
|
2903 c = (c == ' ') ? wp->w_lcs_chars.space |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25749
diff
changeset
|
2904 : wp->w_lcs_chars.nbsp; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2905 if (area_attr == 0 && search_attr == 0) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2906 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2907 n_attr = 1; |
31113
6ff733178f8b
patch 9.0.0891: virtual text below after match has wrong highlight
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2908 wlv.extra_attr = hl_combine_attr(wlv.win_attr, |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2909 HL_ATTR(HLF_8)); |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2910 saved_attr2 = wlv.char_attr; // save current attr |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2911 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2912 mb_c = c; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2913 if (enc_utf8 && utf_char2len(c) > 1) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2914 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2915 mb_utf8 = TRUE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2916 u8cc[0] = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2917 c = 0xc0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2918 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2919 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2920 mb_utf8 = FALSE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2921 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2922 |
29111
bfb205095634
patch 8.2.5076: unnecessary code
Bram Moolenaar <Bram@vim.org>
parents:
29090
diff
changeset
|
2923 if (c == ' ' && ((trailcol != MAXCOL && ptr > line + trailcol) |
bfb205095634
patch 8.2.5076: unnecessary code
Bram Moolenaar <Bram@vim.org>
parents:
29090
diff
changeset
|
2924 || (leadcol != 0 && ptr < line + leadcol))) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2925 { |
29090
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
28788
diff
changeset
|
2926 if (leadcol != 0 && in_multispace && ptr < line + leadcol |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
28788
diff
changeset
|
2927 && wp->w_lcs_chars.leadmultispace != NULL) |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
28788
diff
changeset
|
2928 { |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
28788
diff
changeset
|
2929 c = wp->w_lcs_chars.leadmultispace[multispace_pos++]; |
29111
bfb205095634
patch 8.2.5076: unnecessary code
Bram Moolenaar <Bram@vim.org>
parents:
29090
diff
changeset
|
2930 if (wp->w_lcs_chars.leadmultispace[multispace_pos] |
bfb205095634
patch 8.2.5076: unnecessary code
Bram Moolenaar <Bram@vim.org>
parents:
29090
diff
changeset
|
2931 == NUL) |
29090
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
28788
diff
changeset
|
2932 multispace_pos = 0; |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
28788
diff
changeset
|
2933 } |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
28788
diff
changeset
|
2934 |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
28788
diff
changeset
|
2935 else if (ptr > line + trailcol && wp->w_lcs_chars.trail) |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
28788
diff
changeset
|
2936 c = wp->w_lcs_chars.trail; |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
28788
diff
changeset
|
2937 |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
28788
diff
changeset
|
2938 else if (ptr < line + leadcol && wp->w_lcs_chars.lead) |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
28788
diff
changeset
|
2939 c = wp->w_lcs_chars.lead; |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
28788
diff
changeset
|
2940 |
29111
bfb205095634
patch 8.2.5076: unnecessary code
Bram Moolenaar <Bram@vim.org>
parents:
29090
diff
changeset
|
2941 else if (leadcol != 0 && wp->w_lcs_chars.space) |
29090
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
28788
diff
changeset
|
2942 c = wp->w_lcs_chars.space; |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
28788
diff
changeset
|
2943 |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
28788
diff
changeset
|
2944 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2945 if (!attr_pri) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2946 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2947 n_attr = 1; |
31113
6ff733178f8b
patch 9.0.0891: virtual text below after match has wrong highlight
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2948 wlv.extra_attr = hl_combine_attr(wlv.win_attr, |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2949 HL_ATTR(HLF_8)); |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2950 saved_attr2 = wlv.char_attr; // save current attr |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2951 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2952 mb_c = c; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2953 if (enc_utf8 && utf_char2len(c) > 1) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2954 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2955 mb_utf8 = TRUE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2956 u8cc[0] = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2957 c = 0xc0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2958 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2959 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2960 mb_utf8 = FALSE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2961 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2962 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2963 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2964 // Handling of non-printable characters. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2965 if (!vim_isprintc(c)) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2966 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2967 // when getting a character from the file, we may have to |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2968 // turn it into something else on the way to putting it |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2969 // into "ScreenLines". |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23901
diff
changeset
|
2970 if (c == TAB && (!wp->w_p_list || wp->w_lcs_chars.tab1)) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2971 { |
31315
6a03cc83fcc5
patch 9.0.0991: crash when reading help index with various options set
Bram Moolenaar <Bram@vim.org>
parents:
31297
diff
changeset
|
2972 int tab_len = 0; |
6a03cc83fcc5
patch 9.0.0991: crash when reading help index with various options set
Bram Moolenaar <Bram@vim.org>
parents:
31297
diff
changeset
|
2973 long vcol_adjusted = wlv.vcol; // removed showbreak len |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2974 #ifdef FEAT_LINEBREAK |
31315
6a03cc83fcc5
patch 9.0.0991: crash when reading help index with various options set
Bram Moolenaar <Bram@vim.org>
parents:
31297
diff
changeset
|
2975 char_u *sbr = get_showbreak_value(wp); |
18574
8b0114ffde2b
patch 8.1.2281: 'showbreak' cannot be set for one window
Bram Moolenaar <Bram@vim.org>
parents:
18570
diff
changeset
|
2976 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2977 // only adjust the tab_len, when at the first column |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2978 // after the showbreak value was drawn |
30395
e516c566fd0c
patch 9.0.0533: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30391
diff
changeset
|
2979 if (*sbr != NUL && wlv.vcol == wlv.vcol_sbr && wp->w_p_wrap) |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
2980 vcol_adjusted = wlv.vcol - MB_CHARLEN(sbr); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2981 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2982 // tab amount depends on current column |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2983 #ifdef FEAT_VARTABS |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2984 tab_len = tabstop_padding(vcol_adjusted, |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2985 wp->w_buffer->b_p_ts, |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2986 wp->w_buffer->b_p_vts_array) - 1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2987 #else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2988 tab_len = (int)wp->w_buffer->b_p_ts |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2989 - vcol_adjusted % (int)wp->w_buffer->b_p_ts - 1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2990 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2991 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2992 #ifdef FEAT_LINEBREAK |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2993 if (!wp->w_p_lbr || !wp->w_p_list) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2994 #endif |
31315
6a03cc83fcc5
patch 9.0.0991: crash when reading help index with various options set
Bram Moolenaar <Bram@vim.org>
parents:
31297
diff
changeset
|
2995 { |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2996 // tab amount depends on current column |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
2997 wlv.n_extra = tab_len; |
31315
6a03cc83fcc5
patch 9.0.0991: crash when reading help index with various options set
Bram Moolenaar <Bram@vim.org>
parents:
31297
diff
changeset
|
2998 } |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2999 #ifdef FEAT_LINEBREAK |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3000 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3001 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3002 char_u *p; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3003 int len; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3004 int i; |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3005 int saved_nextra = wlv.n_extra; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3006 |
25749
24b80aa4dd2e
patch 8.2.3410: crash with linebreak, listchars and large tabstop
Bram Moolenaar <Bram@vim.org>
parents:
25711
diff
changeset
|
3007 # ifdef FEAT_CONCEAL |
31986
e0e1ba7daaf4
patch 9.0.1325: 'colorcolumn' highlight wrong with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31944
diff
changeset
|
3008 if (wlv.vcol_off_co > 0) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3009 // there are characters to conceal |
31986
e0e1ba7daaf4
patch 9.0.1325: 'colorcolumn' highlight wrong with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31944
diff
changeset
|
3010 tab_len += wlv.vcol_off_co; |
25749
24b80aa4dd2e
patch 8.2.3410: crash with linebreak, listchars and large tabstop
Bram Moolenaar <Bram@vim.org>
parents:
25711
diff
changeset
|
3011 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3012 // boguscols before FIX_FOR_BOGUSCOLS macro from above |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23901
diff
changeset
|
3013 if (wp->w_p_list && wp->w_lcs_chars.tab1 |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3014 && old_boguscols > 0 |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3015 && wlv.n_extra > tab_len) |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3016 tab_len += wlv.n_extra - tab_len; |
25749
24b80aa4dd2e
patch 8.2.3410: crash with linebreak, listchars and large tabstop
Bram Moolenaar <Bram@vim.org>
parents:
25711
diff
changeset
|
3017 # endif |
30713
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3018 if (tab_len > 0) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3019 { |
31315
6a03cc83fcc5
patch 9.0.0991: crash when reading help index with various options set
Bram Moolenaar <Bram@vim.org>
parents:
31297
diff
changeset
|
3020 // If wlv.n_extra > 0, it gives the number of chars |
6a03cc83fcc5
patch 9.0.0991: crash when reading help index with various options set
Bram Moolenaar <Bram@vim.org>
parents:
31297
diff
changeset
|
3021 // to use for a tab, else we need to calculate the |
6a03cc83fcc5
patch 9.0.0991: crash when reading help index with various options set
Bram Moolenaar <Bram@vim.org>
parents:
31297
diff
changeset
|
3022 // width for a tab. |
30713
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3023 int tab2_len = mb_char2len(wp->w_lcs_chars.tab2); |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3024 len = tab_len * tab2_len; |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3025 if (wp->w_lcs_chars.tab3) |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3026 len += mb_char2len(wp->w_lcs_chars.tab3) |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3027 - tab2_len; |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3028 if (wlv.n_extra > 0) |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3029 len += wlv.n_extra - tab_len; |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3030 c = wp->w_lcs_chars.tab1; |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3031 p = alloc(len + 1); |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3032 if (p == NULL) |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3033 wlv.n_extra = 0; |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3034 else |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3035 { |
30713
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3036 vim_memset(p, ' ', len); |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3037 p[len] = NUL; |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3038 vim_free(wlv.p_extra_free); |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3039 wlv.p_extra_free = p; |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3040 for (i = 0; i < tab_len; i++) |
25749
24b80aa4dd2e
patch 8.2.3410: crash with linebreak, listchars and large tabstop
Bram Moolenaar <Bram@vim.org>
parents:
25711
diff
changeset
|
3041 { |
30713
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3042 int lcs = wp->w_lcs_chars.tab2; |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3043 |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3044 if (*p == NUL) |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3045 { |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3046 tab_len = i; |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3047 break; |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3048 } |
25749
24b80aa4dd2e
patch 8.2.3410: crash with linebreak, listchars and large tabstop
Bram Moolenaar <Bram@vim.org>
parents:
25711
diff
changeset
|
3049 |
30713
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3050 // if tab3 is given, use it for the last |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3051 // char |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3052 if (wp->w_lcs_chars.tab3 |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3053 && i == tab_len - 1) |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3054 lcs = wp->w_lcs_chars.tab3; |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3055 p += mb_char2bytes(lcs, p); |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3056 wlv.n_extra += mb_char2len(lcs) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3057 - (saved_nextra > 0 ? 1 : 0); |
30713
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3058 } |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3059 wlv.p_extra = wlv.p_extra_free; |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3060 # ifdef FEAT_CONCEAL |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3061 // n_extra will be increased by |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3062 // FIX_FOX_BOGUSCOLS macro below, so need to |
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3063 // adjust for that here |
31986
e0e1ba7daaf4
patch 9.0.1325: 'colorcolumn' highlight wrong with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31944
diff
changeset
|
3064 if (wlv.vcol_off_co > 0) |
e0e1ba7daaf4
patch 9.0.1325: 'colorcolumn' highlight wrong with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31944
diff
changeset
|
3065 wlv.n_extra -= wlv.vcol_off_co; |
30713
cb8094ff4f36
patch 9.0.0691: lalloc(0) error in listchars test
Bram Moolenaar <Bram@vim.org>
parents:
30711
diff
changeset
|
3066 # endif |
25749
24b80aa4dd2e
patch 8.2.3410: crash with linebreak, listchars and large tabstop
Bram Moolenaar <Bram@vim.org>
parents:
25711
diff
changeset
|
3067 } |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3068 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3069 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3070 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3071 #ifdef FEAT_CONCEAL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3072 { |
31986
e0e1ba7daaf4
patch 9.0.1325: 'colorcolumn' highlight wrong with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31944
diff
changeset
|
3073 int vc_saved = wlv.vcol_off_co; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3074 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3075 // Tab alignment should be identical regardless of |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3076 // 'conceallevel' value. So tab compensates of all |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3077 // previous concealed characters, and thus resets |
31986
e0e1ba7daaf4
patch 9.0.1325: 'colorcolumn' highlight wrong with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31944
diff
changeset
|
3078 // vcol_off_co and boguscols accumulated so far in the |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3079 // line. Note that the tab can be longer than |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3080 // 'tabstop' when there are concealed characters. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3081 FIX_FOR_BOGUSCOLS; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3082 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3083 // Make sure, the highlighting for the tab char will be |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3084 // correctly set further below (effectively reverts the |
26771
fc859aea8cec
patch 8.2.3914: various spelling mistakes in comments
Bram Moolenaar <Bram@vim.org>
parents:
26690
diff
changeset
|
3085 // FIX_FOR_BOGSUCOLS macro). |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3086 if (wlv.n_extra == tab_len + vc_saved && wp->w_p_list |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23901
diff
changeset
|
3087 && wp->w_lcs_chars.tab1) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3088 tab_len += vc_saved; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3089 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3090 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3091 mb_utf8 = FALSE; // don't draw as UTF-8 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3092 if (wp->w_p_list) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3093 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3094 c = (wlv.n_extra == 0 && wp->w_lcs_chars.tab3) |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23901
diff
changeset
|
3095 ? wp->w_lcs_chars.tab3 |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23901
diff
changeset
|
3096 : wp->w_lcs_chars.tab1; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3097 #ifdef FEAT_LINEBREAK |
31315
6a03cc83fcc5
patch 9.0.0991: crash when reading help index with various options set
Bram Moolenaar <Bram@vim.org>
parents:
31297
diff
changeset
|
3098 if (wp->w_p_lbr && wlv.p_extra != NULL) |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3099 wlv.c_extra = NUL; // using p_extra from above |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3100 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3101 #endif |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3102 wlv.c_extra = wp->w_lcs_chars.tab2; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3103 wlv.c_final = wp->w_lcs_chars.tab3; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3104 n_attr = tab_len + 1; |
31113
6ff733178f8b
patch 9.0.0891: virtual text below after match has wrong highlight
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
3105 wlv.extra_attr = hl_combine_attr(wlv.win_attr, |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3106 HL_ATTR(HLF_8)); |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3107 saved_attr2 = wlv.char_attr; // save current attr |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3108 mb_c = c; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3109 if (enc_utf8 && utf_char2len(c) > 1) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3110 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3111 mb_utf8 = TRUE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3112 u8cc[0] = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3113 c = 0xc0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3114 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3115 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3116 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3117 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3118 wlv.c_final = NUL; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3119 wlv.c_extra = ' '; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3120 c = ' '; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3121 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3122 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3123 else if (c == NUL |
31944
87ed5e064db2
patch 9.0.1304: "$" for 'list' option displayed in wrong position
Bram Moolenaar <Bram@vim.org>
parents:
31938
diff
changeset
|
3124 && wlv.n_extra == 0 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3125 && (wp->w_p_list |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
3126 || ((wlv.fromcol >= 0 || fromcol_prev >= 0) |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
3127 && wlv.tocol > wlv.vcol |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3128 && VIsual_mode != Ctrl_V |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3129 && ( |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3130 # ifdef FEAT_RIGHTLEFT |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3131 wp->w_p_rl ? (wlv.col >= 0) : |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3132 # endif |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3133 (wlv.col < wp->w_width)) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3134 && !(noinvcur |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3135 && lnum == wp->w_cursor.lnum |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3136 && (colnr_T)wlv.vcol == wp->w_virtcol))) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3137 && lcs_eol_one > 0) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3138 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3139 // Display a '$' after the line or highlight an extra |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3140 // character if the line break is included. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3141 #if defined(FEAT_DIFF) || defined(LINE_ATTR) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3142 // For a diff line the highlighting continues after the |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3143 // "$". |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3144 if ( |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3145 # ifdef FEAT_DIFF |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3146 wlv.diff_hlf == (hlf_T)0 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3147 # ifdef LINE_ATTR |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3148 && |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3149 # endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3150 # endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3151 # ifdef LINE_ATTR |
31297
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
3152 wlv.line_attr == 0 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3153 # endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3154 ) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3155 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3156 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3157 // In virtualedit, visual selections may extend |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3158 // beyond end of line. |
29740
b167c91b5f6b
patch 9.0.0210: 'list' mode does not work properly with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29738
diff
changeset
|
3159 if (!(area_highlighting && virtual_active() |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
3160 && wlv.tocol != MAXCOL |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
3161 && wlv.vcol < wlv.tocol)) |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3162 wlv.p_extra = at_end_str; |
29740
b167c91b5f6b
patch 9.0.0210: 'list' mode does not work properly with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29738
diff
changeset
|
3163 wlv.n_extra = 0; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3164 } |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23901
diff
changeset
|
3165 if (wp->w_p_list && wp->w_lcs_chars.eol > 0) |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23901
diff
changeset
|
3166 c = wp->w_lcs_chars.eol; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3167 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3168 c = ' '; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3169 lcs_eol_one = -1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3170 --ptr; // put it back at the NUL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3171 if (!attr_pri) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3172 { |
31113
6ff733178f8b
patch 9.0.0891: virtual text below after match has wrong highlight
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
3173 wlv.extra_attr = hl_combine_attr(wlv.win_attr, |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3174 HL_ATTR(HLF_AT)); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3175 n_attr = 1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3176 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3177 mb_c = c; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3178 if (enc_utf8 && utf_char2len(c) > 1) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3179 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3180 mb_utf8 = TRUE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3181 u8cc[0] = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3182 c = 0xc0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3183 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3184 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3185 mb_utf8 = FALSE; // don't draw as UTF-8 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3186 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3187 else if (c != NUL) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3188 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3189 wlv.p_extra = transchar_buf(wp->w_buffer, c); |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3190 if (wlv.n_extra == 0) |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3191 wlv.n_extra = byte2cells(c) - 1; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3192 #ifdef FEAT_RIGHTLEFT |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3193 if ((dy_flags & DY_UHEX) && wp->w_p_rl) |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3194 rl_mirror(wlv.p_extra); // reverse "<12>" |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3195 #endif |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3196 wlv.c_extra = NUL; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3197 wlv.c_final = NUL; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3198 #ifdef FEAT_LINEBREAK |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3199 if (wp->w_p_lbr) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3200 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3201 char_u *p; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3202 |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3203 c = *wlv.p_extra; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3204 p = alloc(wlv.n_extra + 1); |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3205 vim_memset(p, ' ', wlv.n_extra); |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3206 STRNCPY(p, wlv.p_extra + 1, STRLEN(wlv.p_extra) - 1); |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3207 p[wlv.n_extra] = NUL; |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
3208 vim_free(wlv.p_extra_free); |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
3209 wlv.p_extra_free = wlv.p_extra = p; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3210 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3211 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3212 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3213 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3214 wlv.n_extra = byte2cells(c) - 1; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3215 c = *wlv.p_extra++; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3216 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3217 if (!attr_pri) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3218 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3219 n_attr = wlv.n_extra + 1; |
31113
6ff733178f8b
patch 9.0.0891: virtual text below after match has wrong highlight
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
3220 wlv.extra_attr = hl_combine_attr(wlv.win_attr, |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3221 HL_ATTR(HLF_8)); |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3222 saved_attr2 = wlv.char_attr; // save current attr |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3223 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3224 mb_utf8 = FALSE; // don't draw as UTF-8 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3225 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3226 else if (VIsual_active |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3227 && (VIsual_mode == Ctrl_V |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3228 || VIsual_mode == 'v') |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3229 && virtual_active() |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
3230 && wlv.tocol != MAXCOL |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
3231 && wlv.vcol < wlv.tocol |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3232 && ( |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3233 #ifdef FEAT_RIGHTLEFT |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3234 wp->w_p_rl ? (wlv.col >= 0) : |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3235 #endif |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3236 (wlv.col < wp->w_width))) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3237 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3238 c = ' '; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3239 --ptr; // put it back at the NUL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3240 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3241 #if defined(LINE_ATTR) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3242 else if (( |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3243 # ifdef FEAT_DIFF |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3244 wlv.diff_hlf != (hlf_T)0 || |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3245 # endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3246 # ifdef FEAT_TERMINAL |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3247 wlv.win_attr != 0 || |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3248 # endif |
31297
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
3249 wlv.line_attr != 0 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3250 ) && ( |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3251 # ifdef FEAT_RIGHTLEFT |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3252 wp->w_p_rl ? (wlv.col >= 0) : |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3253 # endif |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3254 (wlv.col |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3255 # ifdef FEAT_CONCEAL |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3256 - wlv.boguscols |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3257 # endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3258 < wp->w_width))) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3259 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3260 // Highlight until the right side of the window |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3261 c = ' '; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3262 --ptr; // put it back at the NUL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3263 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3264 // Remember we do the char for line highlighting. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3265 ++did_line_attr; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3266 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3267 // don't do search HL for the rest of the line |
31297
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
3268 if (wlv.line_attr != 0 && wlv.char_attr == search_attr |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3269 && (did_line_attr > 1 |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23901
diff
changeset
|
3270 || (wp->w_p_list && |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23901
diff
changeset
|
3271 wp->w_lcs_chars.eol > 0))) |
31297
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
3272 wlv.char_attr = wlv.line_attr; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3273 # ifdef FEAT_DIFF |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3274 if (wlv.diff_hlf == HLF_TXD) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3275 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3276 wlv.diff_hlf = HLF_CHD; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3277 if (vi_attr == 0 || wlv.char_attr != vi_attr) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3278 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3279 wlv.char_attr = HL_ATTR(wlv.diff_hlf); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3280 if (wp->w_p_cul && lnum == wp->w_cursor.lnum |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3281 && wp->w_p_culopt_flags != CULOPT_NBR |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3282 && (!wlv.cul_screenline |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3283 || (wlv.vcol >= left_curline_col |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3284 && wlv.vcol <= right_curline_col))) |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3285 wlv.char_attr = hl_combine_attr( |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3286 wlv.char_attr, HL_ATTR(HLF_CUL)); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3287 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3288 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3289 # endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3290 # ifdef FEAT_TERMINAL |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3291 if (wlv.win_attr != 0) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3292 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3293 wlv.char_attr = wlv.win_attr; |
18321
2ffe3309958c
patch 8.1.2155: in a terminal window 'cursorlineopt' does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
18317
diff
changeset
|
3294 if (wp->w_p_cul && lnum == wp->w_cursor.lnum |
2ffe3309958c
patch 8.1.2155: in a terminal window 'cursorlineopt' does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
18317
diff
changeset
|
3295 && wp->w_p_culopt_flags != CULOPT_NBR) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3296 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3297 if (!wlv.cul_screenline |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3298 || (wlv.vcol >= left_curline_col |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3299 && wlv.vcol <= right_curline_col)) |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3300 wlv.char_attr = hl_combine_attr( |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3301 wlv.char_attr, HL_ATTR(HLF_CUL)); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3302 } |
31297
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
3303 else if (wlv.line_attr) |
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
3304 wlv.char_attr = hl_combine_attr( |
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
3305 wlv.char_attr, wlv.line_attr); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3306 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3307 # endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3308 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3309 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3310 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3311 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3312 #ifdef FEAT_CONCEAL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3313 if ( wp->w_p_cole > 0 |
28788
a79f44a2d1ce
patch 8.2.4918: conceal character from matchadd() displayed too many times
Bram Moolenaar <Bram@vim.org>
parents:
28773
diff
changeset
|
3314 && (wp != curwin || lnum != wp->w_cursor.lnum |
a79f44a2d1ce
patch 8.2.4918: conceal character from matchadd() displayed too many times
Bram Moolenaar <Bram@vim.org>
parents:
28773
diff
changeset
|
3315 || conceal_cursor_line(wp)) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3316 && ((syntax_flags & HL_CONCEAL) != 0 || has_match_conc > 0) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3317 && !(lnum_in_visual_area |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3318 && vim_strchr(wp->w_p_cocu, 'v') == NULL)) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3319 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3320 wlv.char_attr = conceal_attr; |
28788
a79f44a2d1ce
patch 8.2.4918: conceal character from matchadd() displayed too many times
Bram Moolenaar <Bram@vim.org>
parents:
28773
diff
changeset
|
3321 if (((prev_syntax_id != syntax_seqnr |
a79f44a2d1ce
patch 8.2.4918: conceal character from matchadd() displayed too many times
Bram Moolenaar <Bram@vim.org>
parents:
28773
diff
changeset
|
3322 && (syntax_flags & HL_CONCEAL) != 0) |
a79f44a2d1ce
patch 8.2.4918: conceal character from matchadd() displayed too many times
Bram Moolenaar <Bram@vim.org>
parents:
28773
diff
changeset
|
3323 || has_match_conc > 1) |
21010
ca2e18364888
patch 8.2.1056: wrong display when mixing match conceal and syntax conceal
Bram Moolenaar <Bram@vim.org>
parents:
20905
diff
changeset
|
3324 && (syn_get_sub_char() != NUL |
ca2e18364888
patch 8.2.1056: wrong display when mixing match conceal and syntax conceal
Bram Moolenaar <Bram@vim.org>
parents:
20905
diff
changeset
|
3325 || (has_match_conc && match_conc) |
ca2e18364888
patch 8.2.1056: wrong display when mixing match conceal and syntax conceal
Bram Moolenaar <Bram@vim.org>
parents:
20905
diff
changeset
|
3326 || wp->w_p_cole == 1) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3327 && wp->w_p_cole != 3) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3328 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3329 // First time at this concealed item: display one |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3330 // character. |
21010
ca2e18364888
patch 8.2.1056: wrong display when mixing match conceal and syntax conceal
Bram Moolenaar <Bram@vim.org>
parents:
20905
diff
changeset
|
3331 if (has_match_conc && match_conc) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3332 c = match_conc; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3333 else if (syn_get_sub_char() != NUL) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3334 c = syn_get_sub_char(); |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23901
diff
changeset
|
3335 else if (wp->w_lcs_chars.conceal != NUL) |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23901
diff
changeset
|
3336 c = wp->w_lcs_chars.conceal; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3337 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3338 c = ' '; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3339 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3340 prev_syntax_id = syntax_seqnr; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3341 |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3342 if (wlv.n_extra > 0) |
31986
e0e1ba7daaf4
patch 9.0.1325: 'colorcolumn' highlight wrong with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31944
diff
changeset
|
3343 wlv.vcol_off_co += wlv.n_extra; |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3344 wlv.vcol += wlv.n_extra; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3345 if (wp->w_p_wrap && wlv.n_extra > 0) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3346 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3347 # ifdef FEAT_RIGHTLEFT |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3348 if (wp->w_p_rl) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3349 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3350 wlv.col -= wlv.n_extra; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3351 wlv.boguscols -= wlv.n_extra; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3352 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3353 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3354 # endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3355 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3356 wlv.boguscols += wlv.n_extra; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3357 wlv.col += wlv.n_extra; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3358 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3359 } |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3360 wlv.n_extra = 0; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3361 n_attr = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3362 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3363 else if (n_skip == 0) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3364 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3365 is_concealing = TRUE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3366 n_skip = 1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3367 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3368 mb_c = c; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3369 if (enc_utf8 && utf_char2len(c) > 1) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3370 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3371 mb_utf8 = TRUE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3372 u8cc[0] = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3373 c = 0xc0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3374 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3375 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3376 mb_utf8 = FALSE; // don't draw as UTF-8 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3377 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3378 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3379 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3380 prev_syntax_id = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3381 is_concealing = FALSE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3382 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3383 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3384 if (n_skip > 0 && did_decrement_ptr) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3385 // not showing the '>', put pointer back to avoid getting stuck |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3386 ++ptr; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3387 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3388 #endif // FEAT_CONCEAL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3389 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3390 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3391 #ifdef FEAT_CONCEAL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3392 // In the cursor line and we may be concealing characters: correct |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3393 // the cursor column when we reach its position. |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3394 if (!did_wcol && wlv.draw_state == WL_LINE |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3395 && wp == curwin && lnum == wp->w_cursor.lnum |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3396 && conceal_cursor_line(wp) |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3397 && (int)wp->w_virtcol <= wlv.vcol + n_skip) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3398 { |
22912
1b1dc9dad42c
patch 8.2.2003: build error with +conceal but without +popupwin
Bram Moolenaar <Bram@vim.org>
parents:
22886
diff
changeset
|
3399 # ifdef FEAT_RIGHTLEFT |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3400 if (wp->w_p_rl) |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3401 wp->w_wcol = wp->w_width - wlv.col + wlv.boguscols - 1; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3402 else |
22912
1b1dc9dad42c
patch 8.2.2003: build error with +conceal but without +popupwin
Bram Moolenaar <Bram@vim.org>
parents:
22886
diff
changeset
|
3403 # endif |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3404 wp->w_wcol = wlv.col - wlv.boguscols; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3405 wp->w_wrow = wlv.row; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3406 did_wcol = TRUE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3407 curwin->w_valid |= VALID_WCOL|VALID_WROW|VALID_VIRTCOL; |
22912
1b1dc9dad42c
patch 8.2.2003: build error with +conceal but without +popupwin
Bram Moolenaar <Bram@vim.org>
parents:
22886
diff
changeset
|
3408 # ifdef FEAT_PROP_POPUP |
22886
38324d4f1c94
patch 8.2.1990: cursor position wrong in terminal popup with finished job
Bram Moolenaar <Bram@vim.org>
parents:
22818
diff
changeset
|
3409 curwin->w_flags &= ~(WFLAG_WCOL_OFF_ADDED | WFLAG_WROW_OFF_ADDED); |
22912
1b1dc9dad42c
patch 8.2.2003: build error with +conceal but without +popupwin
Bram Moolenaar <Bram@vim.org>
parents:
22886
diff
changeset
|
3410 # endif |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3411 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3412 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3413 |
31113
6ff733178f8b
patch 9.0.0891: virtual text below after match has wrong highlight
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
3414 // Use "wlv.extra_attr", but don't override visual selection |
6ff733178f8b
patch 9.0.0891: virtual text below after match has wrong highlight
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
3415 // highlighting, unless text property overrides. |
31323
a93392e93a53
patch 9.0.0995: padding before virtual text is highlighted
Bram Moolenaar <Bram@vim.org>
parents:
31315
diff
changeset
|
3416 // Don't use "wlv.extra_attr" until wlv.n_attr_skip is zero. |
a93392e93a53
patch 9.0.0995: padding before virtual text is highlighted
Bram Moolenaar <Bram@vim.org>
parents:
31315
diff
changeset
|
3417 if (wlv.n_attr_skip == 0 && n_attr > 0 |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3418 && wlv.draw_state == WL_LINE |
29738
4092d04cd46f
patch 9.0.0209: build error with small features
Bram Moolenaar <Bram@vim.org>
parents:
29736
diff
changeset
|
3419 && (!attr_pri |
4092d04cd46f
patch 9.0.0209: build error with small features
Bram Moolenaar <Bram@vim.org>
parents:
29736
diff
changeset
|
3420 #ifdef FEAT_PROP_POPUP |
4092d04cd46f
patch 9.0.0209: build error with small features
Bram Moolenaar <Bram@vim.org>
parents:
29736
diff
changeset
|
3421 || (text_prop_flags & PT_FLAG_OVERRIDE) |
4092d04cd46f
patch 9.0.0209: build error with small features
Bram Moolenaar <Bram@vim.org>
parents:
29736
diff
changeset
|
3422 #endif |
4092d04cd46f
patch 9.0.0209: build error with small features
Bram Moolenaar <Bram@vim.org>
parents:
29736
diff
changeset
|
3423 )) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3424 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3425 #ifdef LINE_ATTR |
31297
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
3426 if (wlv.line_attr) |
d7a532c4d18d
patch 9.0.0982: 'cursorline' not drawn before virtual text below
Bram Moolenaar <Bram@vim.org>
parents:
31283
diff
changeset
|
3427 wlv.char_attr = hl_combine_attr(wlv.line_attr, wlv.extra_attr); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3428 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3429 #endif |
31113
6ff733178f8b
patch 9.0.0891: virtual text below after match has wrong highlight
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
3430 wlv.char_attr = wlv.extra_attr; |
31221
59de2172e99d
patch 9.0.0944: 'cursorline' causes virtual text highlight to continue
Bram Moolenaar <Bram@vim.org>
parents:
31142
diff
changeset
|
3431 #ifdef FEAT_PROP_POPUP |
59de2172e99d
patch 9.0.0944: 'cursorline' causes virtual text highlight to continue
Bram Moolenaar <Bram@vim.org>
parents:
31142
diff
changeset
|
3432 if (reset_extra_attr) |
59de2172e99d
patch 9.0.0944: 'cursorline' causes virtual text highlight to continue
Bram Moolenaar <Bram@vim.org>
parents:
31142
diff
changeset
|
3433 { |
59de2172e99d
patch 9.0.0944: 'cursorline' causes virtual text highlight to continue
Bram Moolenaar <Bram@vim.org>
parents:
31142
diff
changeset
|
3434 reset_extra_attr = FALSE; |
59de2172e99d
patch 9.0.0944: 'cursorline' causes virtual text highlight to continue
Bram Moolenaar <Bram@vim.org>
parents:
31142
diff
changeset
|
3435 wlv.extra_attr = 0; |
59de2172e99d
patch 9.0.0944: 'cursorline' causes virtual text highlight to continue
Bram Moolenaar <Bram@vim.org>
parents:
31142
diff
changeset
|
3436 } |
59de2172e99d
patch 9.0.0944: 'cursorline' causes virtual text highlight to continue
Bram Moolenaar <Bram@vim.org>
parents:
31142
diff
changeset
|
3437 #endif |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3438 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3439 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3440 #if defined(FEAT_XIM) && defined(FEAT_GUI_GTK) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3441 // XIM don't send preedit_start and preedit_end, but they send |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3442 // preedit_changed and commit. Thus Vim can't set "im_is_active", use |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3443 // im_is_preediting() here. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3444 if (p_imst == IM_ON_THE_SPOT |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3445 && xic != NULL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3446 && lnum == wp->w_cursor.lnum |
28773
d770568e6c98
patch 8.2.4911: the mode #defines are not clearly named
Bram Moolenaar <Bram@vim.org>
parents:
28177
diff
changeset
|
3447 && (State & MODE_INSERT) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3448 && !p_imdisable |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3449 && im_is_preediting() |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3450 && wlv.draw_state == WL_LINE) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3451 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3452 colnr_T tcol; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3453 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3454 if (preedit_end_col == MAXCOL) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3455 getvcol(curwin, &(wp->w_cursor), &tcol, NULL, NULL); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3456 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3457 tcol = preedit_end_col; |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3458 if ((long)preedit_start_col <= wlv.vcol && wlv.vcol < (long)tcol) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3459 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3460 if (feedback_old_attr < 0) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3461 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3462 feedback_col = 0; |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3463 feedback_old_attr = wlv.char_attr; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3464 } |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3465 wlv.char_attr = im_get_feedback_attr(feedback_col); |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3466 if (wlv.char_attr < 0) |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3467 wlv.char_attr = feedback_old_attr; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3468 feedback_col++; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3469 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3470 else if (feedback_old_attr >= 0) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3471 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3472 wlv.char_attr = feedback_old_attr; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3473 feedback_old_attr = -1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3474 feedback_col = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3475 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3476 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3477 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3478 // Handle the case where we are in column 0 but not on the first |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3479 // character of the line and the user wants us to show us a |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3480 // special character (via 'listchars' option "precedes:<char>". |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3481 if (lcs_prec_todo != NUL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3482 && wp->w_p_list |
30610
6c6ac189a05f
patch 9.0.0640: cannot scroll by screen line if a line wraps
Bram Moolenaar <Bram@vim.org>
parents:
30509
diff
changeset
|
3483 && (wp->w_p_wrap ? (wp->w_skipcol > 0 && wlv.row == 0) |
6c6ac189a05f
patch 9.0.0640: cannot scroll by screen line if a line wraps
Bram Moolenaar <Bram@vim.org>
parents:
30509
diff
changeset
|
3484 : wp->w_leftcol > 0) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3485 #ifdef FEAT_DIFF |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
3486 && wlv.filler_todo <= 0 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3487 #endif |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3488 && wlv.draw_state > WL_NR |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3489 && c != NUL) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3490 { |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23901
diff
changeset
|
3491 c = wp->w_lcs_chars.prec; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3492 lcs_prec_todo = NUL; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3493 if (has_mbyte && (*mb_char2cells)(mb_c) > 1) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3494 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3495 // Double-width character being overwritten by the "precedes" |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3496 // character, need to fill up half the character. |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3497 wlv.c_extra = MB_FILLER_CHAR; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3498 wlv.c_final = NUL; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3499 wlv.n_extra = 1; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3500 n_attr = 2; |
31113
6ff733178f8b
patch 9.0.0891: virtual text below after match has wrong highlight
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
3501 wlv.extra_attr = |
6ff733178f8b
patch 9.0.0891: virtual text below after match has wrong highlight
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
3502 hl_combine_attr(wlv.win_attr, HL_ATTR(HLF_AT)); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3503 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3504 mb_c = c; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3505 if (enc_utf8 && utf_char2len(c) > 1) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3506 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3507 mb_utf8 = TRUE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3508 u8cc[0] = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3509 c = 0xc0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3510 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3511 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3512 mb_utf8 = FALSE; // don't draw as UTF-8 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3513 if (!attr_pri) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3514 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3515 saved_attr3 = wlv.char_attr; // save current attr |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3516 wlv.char_attr = hl_combine_attr(wlv.win_attr, HL_ATTR(HLF_AT)); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3517 n_attr3 = 1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3518 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3519 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3520 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3521 // At end of the text line or just after the last character. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3522 if ((c == NUL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3523 #if defined(LINE_ATTR) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3524 || did_line_attr == 1 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3525 #endif |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3526 ) && wlv.eol_hl_off == 0) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3527 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3528 #ifdef FEAT_SEARCH_EXTRA |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3529 // flag to indicate whether prevcol equals startcol of search_hl or |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3530 // one of the matches |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3531 int prevcol_hl_flag = get_prevcol_hl_flag(wp, &screen_search_hl, |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3532 (long)(ptr - line) - (c == NUL)); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3533 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3534 // Invert at least one char, used for Visual and empty line or |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3535 // highlight match at end of line. If it's beyond the last |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3536 // char on the screen, just overwrite that one (tricky!) Not |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3537 // needed when a '$' was displayed for 'list'. |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23901
diff
changeset
|
3538 if (wp->w_lcs_chars.eol == lcs_eol_one |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
3539 && ((area_attr != 0 && wlv.vcol == wlv.fromcol |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3540 && (VIsual_mode != Ctrl_V |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3541 || lnum == VIsual.lnum |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3542 || lnum == curwin->w_cursor.lnum) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3543 && c == NUL) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3544 #ifdef FEAT_SEARCH_EXTRA |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3545 // highlight 'hlsearch' match at end of line |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3546 || (prevcol_hl_flag |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3547 # ifdef FEAT_SYN_HL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3548 && !(wp->w_p_cul && lnum == wp->w_cursor.lnum |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3549 && !(wp == curwin && VIsual_active)) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3550 # endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3551 # ifdef FEAT_DIFF |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3552 && wlv.diff_hlf == (hlf_T)0 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3553 # endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3554 # if defined(LINE_ATTR) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3555 && did_line_attr <= 1 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3556 # endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3557 ) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3558 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3559 )) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3560 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3561 int n = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3562 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3563 #ifdef FEAT_RIGHTLEFT |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3564 if (wp->w_p_rl) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3565 { |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3566 if (wlv.col < 0) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3567 n = 1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3568 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3569 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3570 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3571 { |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3572 if (wlv.col >= wp->w_width) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3573 n = -1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3574 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3575 if (n != 0) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3576 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3577 // At the window boundary, highlight the last character |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3578 // instead (better than nothing). |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3579 wlv.off += n; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3580 wlv.col += n; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3581 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3582 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3583 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3584 // Add a blank character to highlight. |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3585 ScreenLines[wlv.off] = ' '; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3586 if (enc_utf8) |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3587 ScreenLinesUC[wlv.off] = 0; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3588 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3589 #ifdef FEAT_SEARCH_EXTRA |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3590 if (area_attr == 0) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3591 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3592 // Use attributes from match with highest priority among |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3593 // 'search_hl' and the match list. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3594 get_search_match_hl(wp, &screen_search_hl, |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3595 (long)(ptr - line), &wlv.char_attr); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3596 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3597 #endif |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3598 ScreenAttrs[wlv.off] = wlv.char_attr; |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3599 ScreenCols[wlv.off] = MAXCOL; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3600 #ifdef FEAT_RIGHTLEFT |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3601 if (wp->w_p_rl) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3602 { |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3603 --wlv.col; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3604 --wlv.off; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3605 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3606 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3607 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3608 { |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3609 ++wlv.col; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3610 ++wlv.off; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3611 } |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3612 ++wlv.vcol; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3613 wlv.eol_hl_off = 1; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3614 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3615 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3616 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3617 // At end of the text line. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3618 if (c == NUL) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3619 { |
31938
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
3620 #ifdef FEAT_PROP_POPUP |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
3621 if (text_prop_follows) |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
3622 { |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
3623 // Put the pointer back to the NUL. |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
3624 --ptr; |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
3625 c = ' '; |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
3626 } |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
3627 else |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
3628 #endif |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3629 { |
31938
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
3630 draw_screen_line(wp, &wlv); |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
3631 |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
3632 // Update w_cline_height and w_cline_folded if the cursor line |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
3633 // was updated (saves a call to plines() later). |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
3634 if (wp == curwin && lnum == curwin->w_cursor.lnum) |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
3635 { |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
3636 curwin->w_cline_row = startrow; |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
3637 curwin->w_cline_height = wlv.row - startrow; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3638 #ifdef FEAT_FOLDING |
31938
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
3639 curwin->w_cline_folded = FALSE; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3640 #endif |
31938
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
3641 curwin->w_valid |= (VALID_CHEIGHT|VALID_CROW); |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
3642 } |
96d6d31dd66b
patch 9.0.1301: virtual text below empty line not displayed
Bram Moolenaar <Bram@vim.org>
parents:
31788
diff
changeset
|
3643 break; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3644 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3645 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3646 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3647 // Show "extends" character from 'listchars' if beyond the line end and |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3648 // 'list' is set. |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23901
diff
changeset
|
3649 if (wp->w_lcs_chars.ext != NUL |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3650 && wlv.draw_state == WL_LINE |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3651 && wp->w_p_list |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3652 && !wp->w_p_wrap |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3653 #ifdef FEAT_DIFF |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
3654 && wlv.filler_todo <= 0 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3655 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3656 && ( |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3657 #ifdef FEAT_RIGHTLEFT |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3658 wp->w_p_rl ? wlv.col == 0 : |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3659 #endif |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3660 wlv.col == wp->w_width - 1) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3661 && (*ptr != NUL |
29740
b167c91b5f6b
patch 9.0.0210: 'list' mode does not work properly with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29738
diff
changeset
|
3662 || lcs_eol_one > 0 |
b167c91b5f6b
patch 9.0.0210: 'list' mode does not work properly with virtual text
Bram Moolenaar <Bram@vim.org>
parents:
29738
diff
changeset
|
3663 || (wlv.n_extra > 0 && (wlv.c_extra != NUL |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3664 || *wlv.p_extra != NUL)))) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3665 { |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23901
diff
changeset
|
3666 c = wp->w_lcs_chars.ext; |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3667 wlv.char_attr = hl_combine_attr(wlv.win_attr, HL_ATTR(HLF_AT)); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3668 mb_c = c; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3669 if (enc_utf8 && utf_char2len(c) > 1) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3670 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3671 mb_utf8 = TRUE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3672 u8cc[0] = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3673 c = 0xc0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3674 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3675 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3676 mb_utf8 = FALSE; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3677 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3678 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3679 #ifdef FEAT_SYN_HL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3680 // advance to the next 'colorcolumn' |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3681 if (wlv.draw_color_col) |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3682 wlv.draw_color_col = advance_color_col(VCOL_HLC, &wlv.color_cols); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3683 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3684 // Highlight the cursor column if 'cursorcolumn' is set. But don't |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3685 // highlight the cursor position itself. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3686 // Also highlight the 'colorcolumn' if it is different than |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3687 // 'cursorcolumn' |
22280
47ebfc274e3f
patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents:
22013
diff
changeset
|
3688 // Also highlight the 'colorcolumn' if 'breakindent' and/or 'showbreak' |
47ebfc274e3f
patch 8.2.1689: 'colorcolumn' doesn't show in indent
Bram Moolenaar <Bram@vim.org>
parents:
22013
diff
changeset
|
3689 // options are set |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3690 vcol_save_attr = -1; |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3691 if (((wlv.draw_state == WL_LINE |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3692 || wlv.draw_state == WL_BRI |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3693 || wlv.draw_state == WL_SBR) |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3694 && !lnum_in_visual_area |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3695 && search_attr == 0 |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3696 && area_attr == 0) |
22818
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
22280
diff
changeset
|
3697 # ifdef FEAT_DIFF |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
3698 && wlv.filler_todo <= 0 |
22818
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
22280
diff
changeset
|
3699 # endif |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
22280
diff
changeset
|
3700 ) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3701 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3702 if (wp->w_p_cuc && VCOL_HLC == (long)wp->w_virtcol |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3703 && lnum != wp->w_cursor.lnum) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3704 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3705 vcol_save_attr = wlv.char_attr; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3706 wlv.char_attr = hl_combine_attr(wlv.char_attr, |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3707 HL_ATTR(HLF_CUC)); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3708 } |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3709 else if (wlv.draw_color_col && VCOL_HLC == *wlv.color_cols) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3710 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3711 vcol_save_attr = wlv.char_attr; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3712 wlv.char_attr = hl_combine_attr(wlv.char_attr, HL_ATTR(HLF_MC)); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3713 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3714 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3715 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3716 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3717 // Store character to be displayed. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3718 // Skip characters that are left of the screen for 'nowrap'. |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3719 vcol_prev = wlv.vcol; |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3720 if (wlv.draw_state < WL_LINE || n_skip <= 0) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3721 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3722 // Store the character. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3723 #if defined(FEAT_RIGHTLEFT) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3724 if (has_mbyte && wp->w_p_rl && (*mb_char2cells)(mb_c) > 1) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3725 { |
26771
fc859aea8cec
patch 8.2.3914: various spelling mistakes in comments
Bram Moolenaar <Bram@vim.org>
parents:
26690
diff
changeset
|
3726 // A double-wide character is: put first half in left cell. |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3727 --wlv.off; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3728 --wlv.col; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3729 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3730 #endif |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3731 ScreenLines[wlv.off] = c; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3732 if (enc_dbcs == DBCS_JPNU) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3733 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3734 if ((mb_c & 0xff00) == 0x8e00) |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3735 ScreenLines[wlv.off] = 0x8e; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3736 ScreenLines2[wlv.off] = mb_c & 0xff; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3737 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3738 else if (enc_utf8) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3739 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3740 if (mb_utf8) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3741 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3742 int i; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3743 |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3744 ScreenLinesUC[wlv.off] = mb_c; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3745 if ((c & 0xff) == 0) |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3746 ScreenLines[wlv.off] = 0x80; // avoid storing zero |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3747 for (i = 0; i < Screen_mco; ++i) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3748 { |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3749 ScreenLinesC[i][wlv.off] = u8cc[i]; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3750 if (u8cc[i] == 0) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3751 break; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3752 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3753 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3754 else |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3755 ScreenLinesUC[wlv.off] = 0; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3756 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3757 if (multi_attr) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3758 { |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3759 ScreenAttrs[wlv.off] = multi_attr; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3760 multi_attr = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3761 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3762 else |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3763 ScreenAttrs[wlv.off] = wlv.char_attr; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3764 |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3765 ScreenCols[wlv.off] = (colnr_T)(prev_ptr - line); |
29413
34e93e046526
patch 9.0.0048: cursor in wrong column with mouse click after concealed text
Bram Moolenaar <Bram@vim.org>
parents:
29387
diff
changeset
|
3766 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3767 if (has_mbyte && (*mb_char2cells)(mb_c) > 1) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3768 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3769 // Need to fill two screen columns. |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3770 ++wlv.off; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3771 ++wlv.col; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3772 if (enc_utf8) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3773 // UTF-8: Put a 0 in the second screen char. |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3774 ScreenLines[wlv.off] = 0; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3775 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3776 // DBCS: Put second byte in the second screen char. |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3777 ScreenLines[wlv.off] = mb_c & 0xff; |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3778 if (wlv.draw_state > WL_NR |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3779 #ifdef FEAT_DIFF |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
3780 && wlv.filler_todo <= 0 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3781 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3782 ) |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3783 ++wlv.vcol; |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
3784 // When "wlv.tocol" is halfway a character, set it to the end |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
3785 // of the character, otherwise highlighting won't stop. |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
3786 if (wlv.tocol == wlv.vcol) |
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
3787 ++wlv.tocol; |
29413
34e93e046526
patch 9.0.0048: cursor in wrong column with mouse click after concealed text
Bram Moolenaar <Bram@vim.org>
parents:
29387
diff
changeset
|
3788 |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3789 ScreenCols[wlv.off] = (colnr_T)(prev_ptr - line); |
29413
34e93e046526
patch 9.0.0048: cursor in wrong column with mouse click after concealed text
Bram Moolenaar <Bram@vim.org>
parents:
29387
diff
changeset
|
3790 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3791 #ifdef FEAT_RIGHTLEFT |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3792 if (wp->w_p_rl) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3793 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3794 // now it's time to backup one cell |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3795 --wlv.off; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3796 --wlv.col; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3797 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3798 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3799 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3800 #ifdef FEAT_RIGHTLEFT |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3801 if (wp->w_p_rl) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3802 { |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3803 --wlv.off; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3804 --wlv.col; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3805 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3806 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3807 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3808 { |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3809 ++wlv.off; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3810 ++wlv.col; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3811 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3812 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3813 #ifdef FEAT_CONCEAL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3814 else if (wp->w_p_cole > 0 && is_concealing) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3815 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3816 --n_skip; |
31986
e0e1ba7daaf4
patch 9.0.1325: 'colorcolumn' highlight wrong with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31944
diff
changeset
|
3817 ++wlv.vcol_off_co; |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3818 if (wlv.n_extra > 0) |
31986
e0e1ba7daaf4
patch 9.0.1325: 'colorcolumn' highlight wrong with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31944
diff
changeset
|
3819 wlv.vcol_off_co += wlv.n_extra; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3820 if (wp->w_p_wrap) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3821 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3822 // Special voodoo required if 'wrap' is on. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3823 // |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3824 // Advance the column indicator to force the line |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3825 // drawing to wrap early. This will make the line |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3826 // take up the same screen space when parts are concealed, |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3827 // so that cursor line computations aren't messed up. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3828 // |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3829 // To avoid the fictitious advance of 'wlv.col' causing |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3830 // trailing junk to be written out of the screen line |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3831 // we are building, 'boguscols' keeps track of the number |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3832 // of bad columns we have advanced. |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3833 if (wlv.n_extra > 0) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3834 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3835 wlv.vcol += wlv.n_extra; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3836 # ifdef FEAT_RIGHTLEFT |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3837 if (wp->w_p_rl) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3838 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3839 wlv.col -= wlv.n_extra; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3840 wlv.boguscols -= wlv.n_extra; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3841 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3842 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3843 # endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3844 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3845 wlv.col += wlv.n_extra; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3846 wlv.boguscols += wlv.n_extra; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3847 } |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3848 wlv.n_extra = 0; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3849 n_attr = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3850 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3851 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3852 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3853 if (has_mbyte && (*mb_char2cells)(mb_c) > 1) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3854 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3855 // Need to fill two screen columns. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3856 # ifdef FEAT_RIGHTLEFT |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3857 if (wp->w_p_rl) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3858 { |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3859 --wlv.boguscols; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3860 --wlv.col; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3861 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3862 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3863 # endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3864 { |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3865 ++wlv.boguscols; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3866 ++wlv.col; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3867 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3868 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3869 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3870 # ifdef FEAT_RIGHTLEFT |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3871 if (wp->w_p_rl) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3872 { |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3873 --wlv.boguscols; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3874 --wlv.col; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3875 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3876 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3877 # endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3878 { |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3879 ++wlv.boguscols; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3880 ++wlv.col; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3881 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3882 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3883 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3884 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3885 if (wlv.n_extra > 0) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3886 { |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3887 wlv.vcol += wlv.n_extra; |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3888 wlv.n_extra = 0; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3889 n_attr = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3890 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3891 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3892 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3893 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3894 #endif // FEAT_CONCEAL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3895 else |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3896 --n_skip; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3897 |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3898 // Only advance the "wlv.vcol" when after the 'number' or |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3899 // 'relativenumber' column. |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3900 if (wlv.draw_state > WL_NR |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3901 #ifdef FEAT_DIFF |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
3902 && wlv.filler_todo <= 0 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3903 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3904 ) |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3905 ++wlv.vcol; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3906 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3907 #ifdef FEAT_SYN_HL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3908 if (vcol_save_attr >= 0) |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3909 wlv.char_attr = vcol_save_attr; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3910 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3911 |
31986
e0e1ba7daaf4
patch 9.0.1325: 'colorcolumn' highlight wrong with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31944
diff
changeset
|
3912 // restore attributes after "precedes" in 'listchars' |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3913 if (wlv.draw_state > WL_NR && n_attr3 > 0 && --n_attr3 == 0) |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3914 wlv.char_attr = saved_attr3; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3915 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3916 // restore attributes after last 'listchars' or 'number' char |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3917 if (n_attr > 0 && wlv.draw_state == WL_LINE |
31323
a93392e93a53
patch 9.0.0995: padding before virtual text is highlighted
Bram Moolenaar <Bram@vim.org>
parents:
31315
diff
changeset
|
3918 && wlv.n_attr_skip == 0 && --n_attr == 0) |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3919 wlv.char_attr = saved_attr2; |
31323
a93392e93a53
patch 9.0.0995: padding before virtual text is highlighted
Bram Moolenaar <Bram@vim.org>
parents:
31315
diff
changeset
|
3920 if (wlv.n_attr_skip > 0) |
a93392e93a53
patch 9.0.0995: padding before virtual text is highlighted
Bram Moolenaar <Bram@vim.org>
parents:
31315
diff
changeset
|
3921 --wlv.n_attr_skip; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3922 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3923 // At end of screen line and there is more to come: Display the line |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3924 // so far. If there is no more to display it is caught above. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3925 if (( |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3926 #ifdef FEAT_RIGHTLEFT |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3927 wp->w_p_rl ? (wlv.col < 0) : |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3928 #endif |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3929 (wlv.col >= wp->w_width)) |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3930 && (wlv.draw_state != WL_LINE |
25170
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24950
diff
changeset
|
3931 || *ptr != NUL |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3932 #ifdef FEAT_DIFF |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
3933 || wlv.filler_todo > 0 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3934 #endif |
29560
14b139cbec49
patch 9.0.0121: cannot put virtual text after or below a line
Bram Moolenaar <Bram@vim.org>
parents:
29550
diff
changeset
|
3935 #ifdef FEAT_PROP_POPUP |
30231
0d084880276a
patch 9.0.0451: virtual text "above" does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
30213
diff
changeset
|
3936 || text_prop_above || text_prop_follows |
29560
14b139cbec49
patch 9.0.0121: cannot put virtual text after or below a line
Bram Moolenaar <Bram@vim.org>
parents:
29550
diff
changeset
|
3937 #endif |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23901
diff
changeset
|
3938 || (wp->w_p_list && wp->w_lcs_chars.eol != NUL |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3939 && wlv.p_extra != at_end_str) |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3940 || (wlv.n_extra != 0 && (wlv.c_extra != NUL |
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3941 || *wlv.p_extra != NUL))) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3942 ) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3943 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3944 #ifdef FEAT_CONCEAL |
30655
0fbf3e042602
patch 9.0.0662: concealed characters do not work correctly
Bram Moolenaar <Bram@vim.org>
parents:
30645
diff
changeset
|
3945 wlv.col -= wlv.boguscols; |
30628
2d7905da4e82
patch 9.0.0649: no indication the first line is broken for 'smoothscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30614
diff
changeset
|
3946 wlv_screen_line(wp, &wlv, FALSE); |
30655
0fbf3e042602
patch 9.0.0662: concealed characters do not work correctly
Bram Moolenaar <Bram@vim.org>
parents:
30645
diff
changeset
|
3947 wlv.col += wlv.boguscols; |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3948 wlv.boguscols = 0; |
31986
e0e1ba7daaf4
patch 9.0.1325: 'colorcolumn' highlight wrong with virtual text above
Bram Moolenaar <Bram@vim.org>
parents:
31944
diff
changeset
|
3949 wlv.vcol_off_co = 0; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3950 #else |
30632
8c0232ab725c
patch 9.0.0651: build fails without the +conceal feature
Bram Moolenaar <Bram@vim.org>
parents:
30628
diff
changeset
|
3951 wlv_screen_line(wp, &wlv, FALSE); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3952 #endif |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3953 ++wlv.row; |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3954 ++wlv.screen_row; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3955 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3956 // When not wrapping and finished diff lines, or when displayed |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3957 // '$' and highlighting until last column, break here. |
30775
a9a46fbfd786
patch 9.0.0722: virtual text "after" does not show with 'list' set
Bram Moolenaar <Bram@vim.org>
parents:
30773
diff
changeset
|
3958 if (((!wp->w_p_wrap |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3959 #ifdef FEAT_DIFF |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
3960 && wlv.filler_todo <= 0 |
29560
14b139cbec49
patch 9.0.0121: cannot put virtual text after or below a line
Bram Moolenaar <Bram@vim.org>
parents:
29550
diff
changeset
|
3961 #endif |
14b139cbec49
patch 9.0.0121: cannot put virtual text after or below a line
Bram Moolenaar <Bram@vim.org>
parents:
29550
diff
changeset
|
3962 #ifdef FEAT_PROP_POPUP |
30775
a9a46fbfd786
patch 9.0.0722: virtual text "after" does not show with 'list' set
Bram Moolenaar <Bram@vim.org>
parents:
30773
diff
changeset
|
3963 && !text_prop_above |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3964 #endif |
30775
a9a46fbfd786
patch 9.0.0722: virtual text "after" does not show with 'list' set
Bram Moolenaar <Bram@vim.org>
parents:
30773
diff
changeset
|
3965 ) || lcs_eol_one == -1) |
a9a46fbfd786
patch 9.0.0722: virtual text "after" does not show with 'list' set
Bram Moolenaar <Bram@vim.org>
parents:
30773
diff
changeset
|
3966 #ifdef FEAT_PROP_POPUP |
a9a46fbfd786
patch 9.0.0722: virtual text "after" does not show with 'list' set
Bram Moolenaar <Bram@vim.org>
parents:
30773
diff
changeset
|
3967 && !text_prop_follows |
a9a46fbfd786
patch 9.0.0722: virtual text "after" does not show with 'list' set
Bram Moolenaar <Bram@vim.org>
parents:
30773
diff
changeset
|
3968 #endif |
a9a46fbfd786
patch 9.0.0722: virtual text "after" does not show with 'list' set
Bram Moolenaar <Bram@vim.org>
parents:
30773
diff
changeset
|
3969 ) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3970 break; |
29635
592818fd3110
patch 9.0.0158: with 'nowrap' "below" property not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
29633
diff
changeset
|
3971 #ifdef FEAT_PROP_POPUP |
30231
0d084880276a
patch 9.0.0451: virtual text "above" does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
30213
diff
changeset
|
3972 if (!wp->w_p_wrap && text_prop_follows && !text_prop_above) |
29635
592818fd3110
patch 9.0.0158: with 'nowrap' "below" property not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
29633
diff
changeset
|
3973 { |
592818fd3110
patch 9.0.0158: with 'nowrap' "below" property not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
29633
diff
changeset
|
3974 // do not output more of the line, only the "below" prop |
592818fd3110
patch 9.0.0158: with 'nowrap' "below" property not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
29633
diff
changeset
|
3975 ptr += STRLEN(ptr); |
592818fd3110
patch 9.0.0158: with 'nowrap' "below" property not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
29633
diff
changeset
|
3976 # ifdef FEAT_LINEBREAK |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
3977 wlv.dont_use_showbreak = TRUE; |
29635
592818fd3110
patch 9.0.0158: with 'nowrap' "below" property not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
29633
diff
changeset
|
3978 # endif |
592818fd3110
patch 9.0.0158: with 'nowrap' "below" property not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
29633
diff
changeset
|
3979 } |
592818fd3110
patch 9.0.0158: with 'nowrap' "below" property not displayed correctly
Bram Moolenaar <Bram@vim.org>
parents:
29633
diff
changeset
|
3980 #endif |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3981 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3982 // When the window is too narrow draw all "@" lines. |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
3983 if (wlv.draw_state != WL_LINE |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3984 #ifdef FEAT_DIFF |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
3985 && wlv.filler_todo <= 0 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3986 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3987 ) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3988 { |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3989 win_draw_end(wp, '@', ' ', TRUE, wlv.row, wp->w_height, HLF_AT); |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3990 draw_vsep_win(wp, wlv.row); |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3991 wlv.row = endrow; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3992 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3993 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3994 // When line got too long for screen break here. |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3995 if (wlv.row == endrow) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3996 { |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
3997 ++wlv.row; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3998 break; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3999 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4000 |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
4001 if (screen_cur_row == wlv.screen_row - 1 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4002 #ifdef FEAT_DIFF |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
4003 && wlv.filler_todo <= 0 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4004 #endif |
29560
14b139cbec49
patch 9.0.0121: cannot put virtual text after or below a line
Bram Moolenaar <Bram@vim.org>
parents:
29550
diff
changeset
|
4005 #ifdef FEAT_PROP_POPUP |
30231
0d084880276a
patch 9.0.0451: virtual text "above" does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
30213
diff
changeset
|
4006 && !text_prop_above && !text_prop_follows |
29560
14b139cbec49
patch 9.0.0121: cannot put virtual text after or below a line
Bram Moolenaar <Bram@vim.org>
parents:
29550
diff
changeset
|
4007 #endif |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4008 && wp->w_width == Columns) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4009 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4010 // Remember that the line wraps, used for modeless copy. |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
4011 LineWraps[wlv.screen_row - 1] = TRUE; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4012 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4013 // Special trick to make copy/paste of wrapped lines work with |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4014 // xterm/screen: write an extra character beyond the end of |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4015 // the line. This will work with all terminal types |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4016 // (regardless of the xn,am settings). |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4017 // Only do this on a fast tty. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4018 // Only do this if the cursor is on the current line |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4019 // (something has been written in it). |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4020 // Don't do this for the GUI. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4021 // Don't do this for double-width characters. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4022 // Don't do this for a window not at the right screen border. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4023 if (p_tf |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4024 #ifdef FEAT_GUI |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4025 && !gui.in_use |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4026 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4027 && !(has_mbyte |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
4028 && ((*mb_off2cells)(LineOffset[wlv.screen_row], |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
4029 LineOffset[wlv.screen_row] + screen_Columns) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4030 == 2 |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
4031 || (*mb_off2cells)( |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
4032 LineOffset[wlv.screen_row - 1] |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
4033 + (int)Columns - 2, |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
4034 LineOffset[wlv.screen_row] |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
4035 + screen_Columns) == 2))) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4036 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4037 // First make sure we are at the end of the screen line, |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4038 // then output the same character again to let the |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4039 // terminal know about the wrap. If the terminal doesn't |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4040 // auto-wrap, we overwrite the character. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4041 if (screen_cur_col != wp->w_width) |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
4042 screen_char(LineOffset[wlv.screen_row - 1] |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
4043 + (unsigned)Columns - 1, |
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
4044 wlv.screen_row - 1, (int)(Columns - 1)); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4045 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4046 // When there is a multi-byte character, just output a |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4047 // space to keep it simple. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4048 if (has_mbyte && MB_BYTE2LEN(ScreenLines[LineOffset[ |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
4049 wlv.screen_row - 1] + (Columns - 1)]) > 1) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4050 out_char(' '); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4051 else |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
4052 out_char(ScreenLines[LineOffset[wlv.screen_row - 1] |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4053 + (Columns - 1)]); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4054 // force a redraw of the first char on the next line |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
4055 ScreenAttrs[LineOffset[wlv.screen_row]] = (sattr_T)-1; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4056 screen_start(); // don't know where cursor is now |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4057 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4058 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4059 |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
4060 win_line_start(wp, &wlv, TRUE); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4061 |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23901
diff
changeset
|
4062 lcs_prec_todo = wp->w_lcs_chars.prec; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4063 #ifdef FEAT_LINEBREAK |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
4064 if (!wlv.dont_use_showbreak |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4065 # ifdef FEAT_DIFF |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
4066 && wlv.filler_todo <= 0 |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4067 # endif |
29615
bab343b21da8
patch 9.0.0148: a "below" aligned text property gets 'showbreak' displayed
Bram Moolenaar <Bram@vim.org>
parents:
29611
diff
changeset
|
4068 ) |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
4069 wlv.need_showbreak = TRUE; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4070 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4071 #ifdef FEAT_DIFF |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
4072 --wlv.filler_todo; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4073 // When the filler lines are actually below the last line of the |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4074 // file, don't draw the line itself, break here. |
30367
95bf6aa369ee
patch 9.0.0519: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30365
diff
changeset
|
4075 if (wlv.filler_todo == 0 && wp->w_botfill) |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4076 break; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4077 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4078 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4079 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4080 } // for every character in the line |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4081 |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4082 #ifdef FEAT_SPELL |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4083 // After an empty line check first word for capital. |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4084 if (*skipwhite(line) == NUL) |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4085 { |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4086 capcol_lnum = lnum + 1; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4087 cap_col = 0; |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4088 } |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4089 #endif |
18763
49b78d6465e5
patch 8.1.2371: FEAT_TEXT_PROP is a confusing name
Bram Moolenaar <Bram@vim.org>
parents:
18720
diff
changeset
|
4090 #ifdef FEAT_PROP_POPUP |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4091 vim_free(text_props); |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4092 vim_free(text_prop_idxs); |
29625
78418bd45852
patch 9.0.0153: no fold and sign column for virtual text with "below" align
Bram Moolenaar <Bram@vim.org>
parents:
29623
diff
changeset
|
4093 vim_free(p_extra_free2); |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4094 #endif |
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4095 |
30391
5aaacdeee0a1
patch 9.0.0531: the win_line() function is much too long
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
4096 vim_free(wlv.p_extra_free); |
29621
f1ed6f520d09
patch 9.0.0151: a "below" aligned text property does not work with 'nowrap'
Bram Moolenaar <Bram@vim.org>
parents:
29615
diff
changeset
|
4097 return wlv.row; |
18124
2a806e3c39f6
patch 8.1.2057: the screen.c file is much too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4098 } |