Mercurial > vim
comparison src/screen.c @ 15636:6f1c7e9a6393 v8.1.0826
patch 8.1.0826: too many #ifdefs
commit https://github.com/vim/vim/commit/29ddebef4038d2d2b3bc9d8d3b0109f4046d6fbf
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 26 17:28:26 2019 +0100
patch 8.1.0826: too many #ifdefs
Problem: Too many #ifdefs.
Solution: Graduate FEAT_VIRTUALEDIT. Adds about 10Kbyte to the code.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 26 Jan 2019 17:30:15 +0100 |
parents | dd2e0b83a660 |
children | adc6442118b8 |
comparison
equal
deleted
inserted
replaced
15635:c51d2a06f5f9 | 15636:6f1c7e9a6393 |
---|---|
1620 * First compute the actual start and end column. | 1620 * First compute the actual start and end column. |
1621 */ | 1621 */ |
1622 if (VIsual_mode == Ctrl_V) | 1622 if (VIsual_mode == Ctrl_V) |
1623 { | 1623 { |
1624 colnr_T fromc, toc; | 1624 colnr_T fromc, toc; |
1625 #if defined(FEAT_VIRTUALEDIT) && defined(FEAT_LINEBREAK) | 1625 #if defined(FEAT_LINEBREAK) |
1626 int save_ve_flags = ve_flags; | 1626 int save_ve_flags = ve_flags; |
1627 | 1627 |
1628 if (curwin->w_p_lbr) | 1628 if (curwin->w_p_lbr) |
1629 ve_flags = VE_ALL; | 1629 ve_flags = VE_ALL; |
1630 #endif | 1630 #endif |
1631 getvcols(wp, &VIsual, &curwin->w_cursor, &fromc, &toc); | 1631 getvcols(wp, &VIsual, &curwin->w_cursor, &fromc, &toc); |
1632 #if defined(FEAT_VIRTUALEDIT) && defined(FEAT_LINEBREAK) | 1632 #if defined(FEAT_LINEBREAK) |
1633 ve_flags = save_ve_flags; | 1633 ve_flags = save_ve_flags; |
1634 #endif | 1634 #endif |
1635 ++toc; | 1635 ++toc; |
1636 if (curwin->w_curswant == MAXCOL) | 1636 if (curwin->w_curswant == MAXCOL) |
1637 toc = MAXCOL; | 1637 toc = MAXCOL; |
3340 tocol = fromcol + 1; | 3340 tocol = fromcol + 1; |
3341 } | 3341 } |
3342 } | 3342 } |
3343 if (VIsual_mode != 'V' && lnum == bot->lnum) | 3343 if (VIsual_mode != 'V' && lnum == bot->lnum) |
3344 { | 3344 { |
3345 if (*p_sel == 'e' && bot->col == 0 | 3345 if (*p_sel == 'e' && bot->col == 0 && bot->coladd == 0) |
3346 #ifdef FEAT_VIRTUALEDIT | |
3347 && bot->coladd == 0 | |
3348 #endif | |
3349 ) | |
3350 { | 3346 { |
3351 fromcol = -10; | 3347 fromcol = -10; |
3352 tocol = MAXCOL; | 3348 tocol = MAXCOL; |
3353 } | 3349 } |
3354 else if (bot->col == MAXCOL) | 3350 else if (bot->col == MAXCOL) |
3543 */ | 3539 */ |
3544 if (vcol < v && ( | 3540 if (vcol < v && ( |
3545 #ifdef FEAT_SYN_HL | 3541 #ifdef FEAT_SYN_HL |
3546 wp->w_p_cuc || draw_color_col || | 3542 wp->w_p_cuc || draw_color_col || |
3547 #endif | 3543 #endif |
3548 #ifdef FEAT_VIRTUALEDIT | |
3549 virtual_active() || | 3544 virtual_active() || |
3550 #endif | |
3551 (VIsual_active && wp->w_buffer == curwin->w_buffer))) | 3545 (VIsual_active && wp->w_buffer == curwin->w_buffer))) |
3552 { | 3546 { |
3553 vcol = v; | 3547 vcol = v; |
3554 } | 3548 } |
3555 | 3549 |
5031 line_attr == 0 | 5025 line_attr == 0 |
5032 # endif | 5026 # endif |
5033 ) | 5027 ) |
5034 #endif | 5028 #endif |
5035 { | 5029 { |
5036 #ifdef FEAT_VIRTUALEDIT | |
5037 /* In virtualedit, visual selections may extend | 5030 /* In virtualedit, visual selections may extend |
5038 * beyond end of line. */ | 5031 * beyond end of line. */ |
5039 if (area_highlighting && virtual_active() | 5032 if (area_highlighting && virtual_active() |
5040 && tocol != MAXCOL && vcol < tocol) | 5033 && tocol != MAXCOL && vcol < tocol) |
5041 n_extra = 0; | 5034 n_extra = 0; |
5042 else | 5035 else |
5043 #endif | |
5044 { | 5036 { |
5045 p_extra = at_end_str; | 5037 p_extra = at_end_str; |
5046 n_extra = 1; | 5038 n_extra = 1; |
5047 c_extra = NUL; | 5039 c_extra = NUL; |
5048 c_final = NUL; | 5040 c_final = NUL; |
5105 extra_attr = HL_ATTR(HLF_8); | 5097 extra_attr = HL_ATTR(HLF_8); |
5106 saved_attr2 = char_attr; /* save current attr */ | 5098 saved_attr2 = char_attr; /* save current attr */ |
5107 } | 5099 } |
5108 mb_utf8 = FALSE; /* don't draw as UTF-8 */ | 5100 mb_utf8 = FALSE; /* don't draw as UTF-8 */ |
5109 } | 5101 } |
5110 #ifdef FEAT_VIRTUALEDIT | |
5111 else if (VIsual_active | 5102 else if (VIsual_active |
5112 && (VIsual_mode == Ctrl_V | 5103 && (VIsual_mode == Ctrl_V |
5113 || VIsual_mode == 'v') | 5104 || VIsual_mode == 'v') |
5114 && virtual_active() | 5105 && virtual_active() |
5115 && tocol != MAXCOL | 5106 && tocol != MAXCOL |
5116 && vcol < tocol | 5107 && vcol < tocol |
5117 && ( | 5108 && ( |
5118 # ifdef FEAT_RIGHTLEFT | 5109 #ifdef FEAT_RIGHTLEFT |
5119 wp->w_p_rl ? (col >= 0) : | 5110 wp->w_p_rl ? (col >= 0) : |
5120 # endif | 5111 #endif |
5121 (col < wp->w_width))) | 5112 (col < wp->w_width))) |
5122 { | 5113 { |
5123 c = ' '; | 5114 c = ' '; |
5124 --ptr; /* put it back at the NUL */ | 5115 --ptr; /* put it back at the NUL */ |
5125 } | 5116 } |
5126 #endif | |
5127 #if defined(LINE_ATTR) | 5117 #if defined(LINE_ATTR) |
5128 else if (( | 5118 else if (( |
5129 # ifdef FEAT_DIFF | 5119 # ifdef FEAT_DIFF |
5130 diff_hlf != (hlf_T)0 || | 5120 diff_hlf != (hlf_T)0 || |
5131 # endif | 5121 # endif |
10864 if ( redraw_cmdline | 10854 if ( redraw_cmdline |
10865 || always | 10855 || always |
10866 || wp->w_cursor.lnum != wp->w_ru_cursor.lnum | 10856 || wp->w_cursor.lnum != wp->w_ru_cursor.lnum |
10867 || wp->w_cursor.col != wp->w_ru_cursor.col | 10857 || wp->w_cursor.col != wp->w_ru_cursor.col |
10868 || wp->w_virtcol != wp->w_ru_virtcol | 10858 || wp->w_virtcol != wp->w_ru_virtcol |
10869 #ifdef FEAT_VIRTUALEDIT | |
10870 || wp->w_cursor.coladd != wp->w_ru_cursor.coladd | 10859 || wp->w_cursor.coladd != wp->w_ru_cursor.coladd |
10871 #endif | |
10872 || wp->w_topline != wp->w_ru_topline | 10860 || wp->w_topline != wp->w_ru_topline |
10873 || wp->w_buffer->b_ml.ml_line_count != wp->w_ru_line_count | 10861 || wp->w_buffer->b_ml.ml_line_count != wp->w_ru_line_count |
10874 #ifdef FEAT_DIFF | 10862 #ifdef FEAT_DIFF |
10875 || wp->w_topfill != wp->w_ru_topfill | 10863 || wp->w_topfill != wp->w_ru_topfill |
10876 #endif | 10864 #endif |