Mercurial > vim
comparison src/screen.c @ 9852:4eea48b76d03 v7.4.2201
commit https://github.com/vim/vim/commit/95ec9d6a6ab3117d60ff638670a803d43974ba51
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Aug 12 18:29:59 2016 +0200
patch 7.4.2201
Problem: The sign column disappears when the last sign is deleted.
Solution: Add the 'signcolumn' option. (Christian Brabandt)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 12 Aug 2016 18:45:06 +0200 |
parents | 664276833670 |
children | 7da89d9c744b |
comparison
equal
deleted
inserted
replaced
9851:eafd017d8a5a | 9852:4eea48b76d03 |
---|---|
2253 if (!got_int) | 2253 if (!got_int) |
2254 got_int = save_got_int; | 2254 got_int = save_got_int; |
2255 #endif | 2255 #endif |
2256 } | 2256 } |
2257 | 2257 |
2258 #ifdef FEAT_SIGNS | |
2259 static int draw_signcolumn(win_T *wp); | |
2260 | |
2261 /* | |
2262 * Return TRUE when window "wp" has a column to draw signs in. | |
2263 */ | |
2264 static int | |
2265 draw_signcolumn(win_T *wp) | |
2266 { | |
2267 return (wp->w_buffer->b_signlist != NULL | |
2268 # ifdef FEAT_NETBEANS_INTG | |
2269 || wp->w_buffer->b_has_sign_column | |
2270 # endif | |
2271 ); | |
2272 } | |
2273 #endif | |
2274 | |
2275 /* | 2258 /* |
2276 * Clear the rest of the window and mark the unused lines with "c1". use "c2" | 2259 * Clear the rest of the window and mark the unused lines with "c1". use "c2" |
2277 * as the filler character. | 2260 * as the filler character. |
2278 */ | 2261 */ |
2279 static void | 2262 static void |
2311 W_ENDCOL(wp) - n, (int)W_ENDCOL(wp), | 2294 W_ENDCOL(wp) - n, (int)W_ENDCOL(wp), |
2312 ' ', ' ', hl_attr(HLF_FC)); | 2295 ' ', ' ', hl_attr(HLF_FC)); |
2313 } | 2296 } |
2314 # endif | 2297 # endif |
2315 # ifdef FEAT_SIGNS | 2298 # ifdef FEAT_SIGNS |
2316 if (draw_signcolumn(wp)) | 2299 if (signcolumn_on(wp)) |
2317 { | 2300 { |
2318 int nn = n + 2; | 2301 int nn = n + 2; |
2319 | 2302 |
2320 /* draw the sign column left of the fold column */ | 2303 /* draw the sign column left of the fold column */ |
2321 if (nn > W_WIDTH(wp)) | 2304 if (nn > W_WIDTH(wp)) |
2361 ' ', ' ', hl_attr(HLF_FC)); | 2344 ' ', ' ', hl_attr(HLF_FC)); |
2362 n = nn; | 2345 n = nn; |
2363 } | 2346 } |
2364 #endif | 2347 #endif |
2365 #ifdef FEAT_SIGNS | 2348 #ifdef FEAT_SIGNS |
2366 if (draw_signcolumn(wp)) | 2349 if (signcolumn_on(wp)) |
2367 { | 2350 { |
2368 int nn = n + 2; | 2351 int nn = n + 2; |
2369 | 2352 |
2370 /* draw the sign column after the fold column */ | 2353 /* draw the sign column after the fold column */ |
2371 if (nn > W_WIDTH(wp)) | 2354 if (nn > W_WIDTH(wp)) |
2505 * text */ | 2488 * text */ |
2506 RL_MEMSET(col, hl_attr(HLF_FL), W_WIDTH(wp) - col); | 2489 RL_MEMSET(col, hl_attr(HLF_FL), W_WIDTH(wp) - col); |
2507 | 2490 |
2508 #ifdef FEAT_SIGNS | 2491 #ifdef FEAT_SIGNS |
2509 /* If signs are being displayed, add two spaces. */ | 2492 /* If signs are being displayed, add two spaces. */ |
2510 if (draw_signcolumn(wp)) | 2493 if (signcolumn_on(wp)) |
2511 { | 2494 { |
2512 len = W_WIDTH(wp) - col; | 2495 len = W_WIDTH(wp) - col; |
2513 if (len > 0) | 2496 if (len > 0) |
2514 { | 2497 { |
2515 if (len > 2) | 2498 if (len > 2) |
3675 if (draw_state == WL_SIGN - 1 && n_extra == 0) | 3658 if (draw_state == WL_SIGN - 1 && n_extra == 0) |
3676 { | 3659 { |
3677 draw_state = WL_SIGN; | 3660 draw_state = WL_SIGN; |
3678 /* Show the sign column when there are any signs in this | 3661 /* Show the sign column when there are any signs in this |
3679 * buffer or when using Netbeans. */ | 3662 * buffer or when using Netbeans. */ |
3680 if (draw_signcolumn(wp)) | 3663 if (signcolumn_on(wp)) |
3681 { | 3664 { |
3682 int text_sign; | 3665 int text_sign; |
3683 # ifdef FEAT_SIGN_ICONS | 3666 # ifdef FEAT_SIGN_ICONS |
3684 int icon_sign; | 3667 int icon_sign; |
3685 # endif | 3668 # endif |