-
diff -ru vim-7.3.000+hg~ee53a39d5896/runtime/doc/eval.txt vim-7.3.000+hg~ee53a39d5896~bri/runtime/doc/eval.txt
|
old
|
new
|
|
| 6143 | 6143 | keymap Compiled with 'keymap' support. |
| 6144 | 6144 | langmap Compiled with 'langmap' support. |
| 6145 | 6145 | libcall Compiled with |libcall()| support. |
| 6146 | | linebreak Compiled with 'linebreak', 'breakat' and 'showbreak' |
| 6147 | | support. |
| | 6146 | linebreak Compiled with 'linebreak', 'breakat', 'showbreak' and |
| | 6147 | 'breakindent' support. |
| 6148 | 6148 | lispindent Compiled with support for lisp indenting. |
| 6149 | 6149 | listcmds Compiled with commands for the buffer list |:files| |
| 6150 | 6150 | and the argument list |arglist|. |
-
diff -ru vim-7.3.000+hg~ee53a39d5896/runtime/doc/options.txt vim-7.3.000+hg~ee53a39d5896~bri/runtime/doc/options.txt
|
old
|
new
|
|
| 1165 | 1165 | break if 'linebreak' is on. Only works for ASCII and also for 8-bit |
| 1166 | 1166 | characters when 'encoding' is an 8-bit encoding. |
| 1167 | 1167 | |
| | 1168 | |
| | 1169 | *'breakindent'* *'bri'* |
| | 1170 | 'breakindent' 'bri' boolean (default off) |
| | 1171 | local to window |
| | 1172 | {not in Vi} |
| | 1173 | {not available when compiled without the |+linebreak| |
| | 1174 | feature} |
| | 1175 | Every wrapped line will continue visually indented (same amount of |
| | 1176 | space as the beginning of that line), thus preserving horizontal blocks |
| | 1177 | of text. |
| | 1178 | |
| | 1179 | *'breakindentmin'* *'brimin'* |
| | 1180 | 'breakindentmin' 'brimin' number (default 20) |
| | 1181 | local to window |
| | 1182 | {not in Vi} |
| | 1183 | {not available when compiled without the |+linebreak| |
| | 1184 | feature} |
| | 1185 | Minimum text width that will be kept after applying 'breakindent', |
| | 1186 | even if the resulting text should normally be narrower. This prevents |
| | 1187 | text indented almost to the right window border oocupying lot of |
| | 1188 | vertical space when broken. |
| | 1189 | |
| | 1190 | *'breakindentshift'* *'brishift'* |
| | 1191 | 'breakindentshift' 'brishift' number (default 20) |
| | 1192 | local to window |
| | 1193 | {not in Vi} |
| | 1194 | {not available when compiled without the |+linebreak| |
| | 1195 | feature} |
| | 1196 | After applying 'breakindent', wrapped line beginning will be shift by |
| | 1197 | given number of characters. It permits dynamic French paragraph |
| | 1198 | indentation (negative) or emphasizing the line continuation |
| | 1199 | (positive). |
| | 1200 | |
| 1168 | 1201 | *'browsedir'* *'bsdir'* |
| 1169 | 1202 | 'browsedir' 'bsdir' string (default: "last") |
| 1170 | 1203 | global |
| … |
… |
|
| 4409 | 4442 | {not in Vi} |
| 4410 | 4443 | {not available when compiled without the |+linebreak| |
| 4411 | 4444 | feature} |
| 4412 | | If on Vim will wrap long lines at a character in 'breakat' rather |
| | 4445 | If on, Vim will wrap long lines at a character in 'breakat' rather |
| 4413 | 4446 | than at the last character that fits on the screen. Unlike |
| 4414 | 4447 | 'wrapmargin' and 'textwidth', this does not insert <EOL>s in the file, |
| 4415 | | it only affects the way the file is displayed, not its contents. The |
| 4416 | | value of 'showbreak' is used to put in front of wrapped lines. |
| 4417 | | This option is not used when the 'wrap' option is off or 'list' is on. |
| | 4448 | it only affects the way the file is displayed, not its contents. |
| | 4449 | If 'breakindent' is set, line is visually indented. Then, the value |
| | 4450 | of 'showbreak' is used to put in front of wrapped lines. This option |
| | 4451 | is not used when the 'wrap' option is off or 'list' is on. |
| 4418 | 4452 | Note that <Tab> characters after an <EOL> are mostly not displayed |
| 4419 | 4453 | with the right amount of white space. |
| 4420 | 4454 | |
-
diff -ru vim-7.3.000+hg~ee53a39d5896/runtime/doc/tags vim-7.3.000+hg~ee53a39d5896~bri/runtime/doc/tags
|
old
|
new
|
|
| 90 | 90 | 'bl' options.txt /*'bl'* |
| 91 | 91 | 'bomb' options.txt /*'bomb'* |
| 92 | 92 | 'breakat' options.txt /*'breakat'* |
| | 93 | 'breakindent' options.txt /*'breakindent'* |
| | 94 | 'breakindentmin' options.txt /*'breakindentmin'* |
| | 95 | 'breakindentshift' options.txt /*'breakindentshift'* |
| | 96 | 'bri' options.txt /*'bri'* |
| | 97 | 'brimin' options.txt /*'brimin'* |
| | 98 | 'brishift' options.txt /*'brishift'* |
| 93 | 99 | 'brk' options.txt /*'brk'* |
| 94 | 100 | 'browsedir' options.txt /*'browsedir'* |
| 95 | 101 | 'bs' options.txt /*'bs'* |
-
diff -ru vim-7.3.000+hg~ee53a39d5896/runtime/optwin.vim vim-7.3.000+hg~ee53a39d5896~bri/runtime/optwin.vim
|
old
|
new
|
|
| 329 | 329 | call append("$", "linebreak\twrap long lines at a character in 'breakat'") |
| 330 | 330 | call append("$", "\t(local to window)") |
| 331 | 331 | call <SID>BinOptionL("lbr") |
| | 332 | call append("$", "breakindent\tpreserve indentation in wrapped text") |
| | 333 | call append("$", "\t(local to window)") |
| | 334 | call <SID>BinOptionL("bri") |
| | 335 | call append("$", "breakindentmin\tminimum text width after indent in 'breakindent'") |
| | 336 | call append("$", "\t(local to window)") |
| | 337 | call <SID>OptionL("brimin") |
| | 338 | call append("$", "breakindentshift\tshift beginning of 'breakindent'ed line by this number of characters (negative left)") |
| | 339 | call append("$", "\t(local to window)") |
| | 340 | call <SID>OptionL("brishift") |
| 332 | 341 | call append("$", "breakat\twhich characters might cause a line break") |
| 333 | 342 | call <SID>OptionG("brk", &brk) |
| 334 | 343 | call append("$", "showbreak\tstring to put before wrapped screen lines") |
-
diff -ru vim-7.3.000+hg~ee53a39d5896/src/edit.c vim-7.3.000+hg~ee53a39d5896~bri/src/edit.c
|
old
|
new
|
|
| 394 | 394 | if (startln) |
| 395 | 395 | Insstart.col = 0; |
| 396 | 396 | } |
| 397 | | Insstart_textlen = (colnr_T)linetabsize(ml_get_curline()); |
| | 397 | Insstart_textlen = (colnr_T)linetabsize(ml_get_curline(), Insstart.lnum); |
| 398 | 398 | Insstart_blank_vcol = MAXCOL; |
| 399 | 399 | if (!did_ai) |
| 400 | 400 | ai_col = 0; |
| … |
… |
|
| 1852 | 1852 | else |
| 1853 | 1853 | #endif |
| 1854 | 1854 | ++new_cursor_col; |
| 1855 | | vcol += lbr_chartabsize(ptr + new_cursor_col, (colnr_T)vcol); |
| | 1855 | vcol += lbr_chartabsize(ptr + new_cursor_col, (colnr_T)vcol, curwin->w_cursor.lnum); |
| 1856 | 1856 | } |
| 1857 | 1857 | vcol = last_vcol; |
| 1858 | 1858 | |
| … |
… |
|
| 6424 | 6424 | ins_need_undo = FALSE; |
| 6425 | 6425 | } |
| 6426 | 6426 | Insstart = curwin->w_cursor; /* new insertion starts here */ |
| 6427 | | Insstart_textlen = (colnr_T)linetabsize(ml_get_curline()); |
| | 6427 | Insstart_textlen = (colnr_T)linetabsize(ml_get_curline(), curwin->w_cursor.lnum); |
| 6428 | 6428 | ai_col = 0; |
| 6429 | 6429 | #ifdef FEAT_VREPLACE |
| 6430 | 6430 | if (State & VREPLACE_FLAG) |
| … |
… |
|
| 6783 | 6783 | for (;;) |
| 6784 | 6784 | { |
| 6785 | 6785 | coladvance(v - width); |
| 6786 | | /* getviscol() is slow, skip it when 'showbreak' is empty and |
| 6787 | | * there are no multi-byte characters */ |
| 6788 | | if ((*p_sbr == NUL |
| | 6786 | /* getviscol() is slow, skip it when 'showbreak' is empty, |
| | 6787 | * 'breakindent' is not set and there are no multi-byte |
| | 6788 | * characters */ |
| | 6789 | if ((*p_sbr == NUL && !curwin->w_p_bri |
| 6789 | 6790 | # ifdef FEAT_MBYTE |
| 6790 | 6791 | && !has_mbyte |
| 6791 | 6792 | # endif |
| … |
… |
|
| 9421 | 9422 | getvcol(curwin, &fpos, &vcol, NULL, NULL); |
| 9422 | 9423 | getvcol(curwin, cursor, &want_vcol, NULL, NULL); |
| 9423 | 9424 | |
| 9424 | | /* Use as many TABs as possible. Beware of 'showbreak' and |
| | 9425 | /* Use as many TABs as possible. Beware of 'breakindent', 'showbreak' and |
| 9425 | 9426 | * 'linebreak' adding extra virtual columns. */ |
| 9426 | 9427 | while (vim_iswhite(*ptr)) |
| 9427 | 9428 | { |
| 9428 | | i = lbr_chartabsize((char_u *)"\t", vcol); |
| | 9429 | i = lbr_chartabsize((char_u *)"\t", vcol, cursor->lnum); |
| 9429 | 9430 | if (vcol + i > want_vcol) |
| 9430 | 9431 | break; |
| 9431 | 9432 | if (*ptr != TAB) |
| … |
… |
|
| 9451 | 9452 | /* Skip over the spaces we need. */ |
| 9452 | 9453 | while (vcol < want_vcol && *ptr == ' ') |
| 9453 | 9454 | { |
| 9454 | | vcol += lbr_chartabsize(ptr, vcol); |
| | 9455 | vcol += lbr_chartabsize(ptr, vcol, cursor->lnum); |
| 9455 | 9456 | ++ptr; |
| 9456 | 9457 | ++repl_off; |
| 9457 | 9458 | } |
| … |
… |
|
| 9702 | 9703 | while ((colnr_T)temp < curwin->w_virtcol && *ptr != NUL) |
| 9703 | 9704 | { |
| 9704 | 9705 | prev_ptr = ptr; |
| 9705 | | temp += lbr_chartabsize_adv(&ptr, (colnr_T)temp); |
| | 9706 | temp += lbr_chartabsize_adv(&ptr, (colnr_T)temp, lnum); |
| 9706 | 9707 | } |
| 9707 | 9708 | if ((colnr_T)temp > curwin->w_virtcol) |
| 9708 | 9709 | ptr = prev_ptr; |
-
diff -ru vim-7.3.000+hg~ee53a39d5896/src/eval.c vim-7.3.000+hg~ee53a39d5896~bri/src/eval.c
|
old
|
new
|
|
| 16857 | 16857 | |
| 16858 | 16858 | if (argvars[1].v_type != VAR_UNKNOWN) |
| 16859 | 16859 | col = get_tv_number(&argvars[1]); |
| 16860 | | |
| 16861 | | rettv->vval.v_number = (varnumber_T)(linetabsize_col(col, s) - col); |
| | 16860 | /* |
| | 16861 | * FIXME: passing 0 as 3rd argument to linetabsize_col, instead of real line number; |
| | 16862 | * (can we get it from here somehow?); might give incorrect result with breakindent! |
| | 16863 | */ |
| | 16864 | rettv->vval.v_number = (varnumber_T)(linetabsize_col(col, s, 0) - col); |
| 16862 | 16865 | } |
| 16863 | 16866 | |
| 16864 | 16867 | /* |
-
diff -ru vim-7.3.000+hg~ee53a39d5896/src/ex_cmds.c vim-7.3.000+hg~ee53a39d5896~bri/src/ex_cmds.c
|
old
|
new
|
|
| 266 | 266 | ; |
| 267 | 267 | save = *last; |
| 268 | 268 | *last = NUL; |
| 269 | | len = linetabsize(line); /* get line length */ |
| | 269 | len = linetabsize(line, curwin->w_cursor.lnum); /* get line length */ |
| 270 | 270 | if (has_tab != NULL) /* check for embedded TAB */ |
| 271 | 271 | *has_tab = (vim_strrchr(first, TAB) != NULL); |
| 272 | 272 | *last = save; |
-
diff -ru vim-7.3.000+hg~ee53a39d5896/src/getchar.c vim-7.3.000+hg~ee53a39d5896~bri/src/getchar.c
|
old
|
new
|
|
| 2602 | 2602 | if (!vim_iswhite(ptr[col])) |
| 2603 | 2603 | curwin->w_wcol = vcol; |
| 2604 | 2604 | vcol += lbr_chartabsize(ptr + col, |
| 2605 | | (colnr_T)vcol); |
| | 2605 | (colnr_T)vcol, curwin->w_cursor.lnum); |
| 2606 | 2606 | #ifdef FEAT_MBYTE |
| 2607 | 2607 | if (has_mbyte) |
| 2608 | 2608 | col += (*mb_ptr2len)(ptr + col); |
-
diff -ru vim-7.3.000+hg~ee53a39d5896/src/gui_beval.c vim-7.3.000+hg~ee53a39d5896~bri/src/gui_beval.c
|
old
|
new
|
|
| 335 | 335 | { |
| 336 | 336 | /* Not past end of the file. */ |
| 337 | 337 | lbuf = ml_get_buf(wp->w_buffer, lnum, FALSE); |
| 338 | | if (col <= win_linetabsize(wp, lbuf, (colnr_T)MAXCOL)) |
| | 338 | if (col <= win_linetabsize(wp, lbuf, (colnr_T)MAXCOL, lnum)) |
| 339 | 339 | { |
| 340 | 340 | /* Not past end of line. */ |
| 341 | 341 | if (getword) |
-
diff -ru vim-7.3.000+hg~ee53a39d5896/src/charset.c vim-7.3.000+hg~ee53a39d5896~bri/src/charset.c
|
old
|
new
|
|
| 846 | 846 | * taking into account the size of a tab. |
| 847 | 847 | */ |
| 848 | 848 | int |
| 849 | | linetabsize(s) |
| | 849 | linetabsize(s, lnum) |
| 850 | 850 | char_u *s; |
| | 851 | linenr_T lnum; |
| 851 | 852 | { |
| 852 | | return linetabsize_col(0, s); |
| | 853 | return linetabsize_col(0, s, lnum); |
| 853 | 854 | } |
| 854 | 855 | |
| 855 | 856 | /* |
| 856 | 857 | * Like linetabsize(), but starting at column "startcol". |
| 857 | 858 | */ |
| 858 | 859 | int |
| 859 | | linetabsize_col(startcol, s) |
| | 860 | linetabsize_col(startcol, s, lnum) |
| 860 | 861 | int startcol; |
| 861 | 862 | char_u *s; |
| | 863 | linenr_T lnum; |
| 862 | 864 | { |
| 863 | 865 | colnr_T col = startcol; |
| 864 | 866 | |
| 865 | 867 | while (*s != NUL) |
| 866 | | col += lbr_chartabsize_adv(&s, col); |
| | 868 | col += lbr_chartabsize_adv(&s, col, lnum); |
| 867 | 869 | return (int)col; |
| 868 | 870 | } |
| 869 | 871 | |
| … |
… |
|
| 871 | 873 | * Like linetabsize(), but for a given window instead of the current one. |
| 872 | 874 | */ |
| 873 | 875 | int |
| 874 | | win_linetabsize(wp, p, len) |
| | 876 | win_linetabsize(wp, p, len, lnum) |
| 875 | 877 | win_T *wp; |
| 876 | 878 | char_u *p; |
| 877 | 879 | colnr_T len; |
| | 880 | linenr_T lnum; |
| 878 | 881 | { |
| 879 | 882 | colnr_T col = 0; |
| 880 | 883 | char_u *s; |
| 881 | 884 | |
| 882 | 885 | for (s = p; *s != NUL && (len == MAXCOL || s < p + len); mb_ptr_adv(s)) |
| 883 | | col += win_lbr_chartabsize(wp, s, col, NULL); |
| | 886 | col += win_lbr_chartabsize(wp, s, col, NULL, lnum); |
| 884 | 887 | return (int)col; |
| 885 | 888 | } |
| 886 | 889 | |
| … |
… |
|
| 1009 | 1012 | * like chartabsize(), but also check for line breaks on the screen |
| 1010 | 1013 | */ |
| 1011 | 1014 | int |
| 1012 | | lbr_chartabsize(s, col) |
| | 1015 | lbr_chartabsize(s, col, lnum) |
| 1013 | 1016 | unsigned char *s; |
| 1014 | 1017 | colnr_T col; |
| | 1018 | linenr_T lnum; |
| 1015 | 1019 | { |
| 1016 | 1020 | #ifdef FEAT_LINEBREAK |
| 1017 | | if (!curwin->w_p_lbr && *p_sbr == NUL) |
| | 1021 | if (!curwin->w_p_lbr && *p_sbr == NUL && !curwin->w_p_bri) |
| 1018 | 1022 | { |
| 1019 | 1023 | #endif |
| 1020 | 1024 | #ifdef FEAT_MBYTE |
| … |
… |
|
| 1024 | 1028 | RET_WIN_BUF_CHARTABSIZE(curwin, curbuf, s, col) |
| 1025 | 1029 | #ifdef FEAT_LINEBREAK |
| 1026 | 1030 | } |
| 1027 | | return win_lbr_chartabsize(curwin, s, col, NULL); |
| | 1031 | return win_lbr_chartabsize(curwin, s, col, NULL, lnum); |
| 1028 | 1032 | #endif |
| 1029 | 1033 | } |
| 1030 | 1034 | |
| … |
… |
|
| 1032 | 1036 | * Call lbr_chartabsize() and advance the pointer. |
| 1033 | 1037 | */ |
| 1034 | 1038 | int |
| 1035 | | lbr_chartabsize_adv(s, col) |
| | 1039 | lbr_chartabsize_adv(s, col, lnum) |
| 1036 | 1040 | char_u **s; |
| 1037 | 1041 | colnr_T col; |
| | 1042 | linenr_T lnum; |
| 1038 | 1043 | { |
| 1039 | 1044 | int retval; |
| 1040 | 1045 | |
| 1041 | | retval = lbr_chartabsize(*s, col); |
| | 1046 | retval = lbr_chartabsize(*s, col, lnum); |
| 1042 | 1047 | mb_ptr_adv(*s); |
| 1043 | 1048 | return retval; |
| 1044 | 1049 | } |
| … |
… |
|
| 1049 | 1054 | * If "headp" not NULL, set *headp to the size of what we for 'showbreak' |
| 1050 | 1055 | * string at start of line. Warning: *headp is only set if it's a non-zero |
| 1051 | 1056 | * value, init to 0 before calling. |
| | 1057 | * |
| | 1058 | * linenr argument needed if in visual highlighting and breakindent=on, then |
| | 1059 | * the line calculated is not current; if 0, normal functionality is preserved. |
| 1052 | 1060 | */ |
| 1053 | 1061 | int |
| 1054 | | win_lbr_chartabsize(wp, s, col, headp) |
| | 1062 | win_lbr_chartabsize(wp, s, col, headp, lnum) |
| 1055 | 1063 | win_T *wp; |
| 1056 | 1064 | char_u *s; |
| 1057 | 1065 | colnr_T col; |
| 1058 | 1066 | int *headp UNUSED; |
| | 1067 | linenr_T lnum; |
| 1059 | 1068 | { |
| 1060 | 1069 | #ifdef FEAT_LINEBREAK |
| 1061 | 1070 | int c; |
| … |
… |
|
| 1074 | 1083 | int n; |
| 1075 | 1084 | |
| 1076 | 1085 | /* |
| 1077 | | * No 'linebreak' and 'showbreak': return quickly. |
| | 1086 | * No 'linebreak' and 'showbreak' and 'breakindent': return quickly. |
| 1078 | 1087 | */ |
| 1079 | | if (!wp->w_p_lbr && *p_sbr == NUL) |
| | 1088 | if (!wp->w_p_lbr && !wp->w_p_bri && *p_sbr == NUL) |
| 1080 | 1089 | #endif |
| 1081 | 1090 | { |
| 1082 | 1091 | #ifdef FEAT_MBYTE |
| … |
… |
|
| 1151 | 1160 | # endif |
| 1152 | 1161 | |
| 1153 | 1162 | /* |
| 1154 | | * May have to add something for 'showbreak' string at start of line |
| | 1163 | * May have to add something for 'breakindent' and/or 'showbreak' |
| | 1164 | * string at start of line. |
| 1155 | 1165 | * Set *headp to the size of what we add. |
| 1156 | 1166 | */ |
| 1157 | 1167 | added = 0; |
| 1158 | | if (*p_sbr != NUL && wp->w_p_wrap && col != 0) |
| | 1168 | if ((*p_sbr != NUL || wp->w_p_bri) && wp->w_p_wrap && col != 0) |
| 1159 | 1169 | { |
| 1160 | 1170 | numberextra = win_col_off(wp); |
| 1161 | 1171 | col += numberextra + mb_added; |
| … |
… |
|
| 1168 | 1178 | } |
| 1169 | 1179 | if (col == 0 || col + size > (colnr_T)W_WIDTH(wp)) |
| 1170 | 1180 | { |
| 1171 | | added = vim_strsize(p_sbr); |
| | 1181 | added = 0; |
| | 1182 | if (*p_sbr != NUL) |
| | 1183 | added += vim_strsize(p_sbr); |
| | 1184 | if (wp->w_p_bri) |
| | 1185 | added += get_breakindent_win(wp,lnum); |
| | 1186 | |
| 1172 | 1187 | if (tab_corr) |
| 1173 | 1188 | size += (added / wp->w_buffer->b_p_ts) * wp->w_buffer->b_p_ts; |
| 1174 | 1189 | else |
| … |
… |
|
| 1276 | 1291 | |
| 1277 | 1292 | /* |
| 1278 | 1293 | * This function is used very often, do some speed optimizations. |
| 1279 | | * When 'list', 'linebreak' and 'showbreak' are not set use a simple loop. |
| | 1294 | * When 'list', 'linebreak', 'showbreak' and 'breakindent' are not set |
| | 1295 | * use a simple loop. |
| 1280 | 1296 | * Also use this when 'list' is set but tabs take their normal size. |
| 1281 | 1297 | */ |
| 1282 | 1298 | if ((!wp->w_p_list || lcs_tab1 != NUL) |
| 1283 | 1299 | #ifdef FEAT_LINEBREAK |
| 1284 | | && !wp->w_p_lbr && *p_sbr == NUL |
| | 1300 | && !wp->w_p_lbr && *p_sbr == NUL && !wp->w_p_bri |
| 1285 | 1301 | #endif |
| 1286 | 1302 | ) |
| 1287 | 1303 | { |
| … |
… |
|
| 1343 | 1359 | { |
| 1344 | 1360 | /* A tab gets expanded, depending on the current column */ |
| 1345 | 1361 | head = 0; |
| 1346 | | incr = win_lbr_chartabsize(wp, ptr, vcol, &head); |
| | 1362 | incr = win_lbr_chartabsize(wp, ptr, vcol, &head, pos->lnum); |
| 1347 | 1363 | /* make sure we don't go past the end of the line */ |
| 1348 | 1364 | if (*ptr == NUL) |
| 1349 | 1365 | { |
-
diff -ru vim-7.3.000+hg~ee53a39d5896/src/misc1.c vim-7.3.000+hg~ee53a39d5896~bri/src/misc1.c
|
old
|
new
|
|
| 451 | 451 | return (int)col; |
| 452 | 452 | } |
| 453 | 453 | |
| | 454 | #ifdef FEAT_LINEBREAK |
| | 455 | /* |
| | 456 | * Return appropriate space number for breakindent, taking influencing |
| | 457 | * parameters into account. Window must be specified, since it is not |
| | 458 | * necessarily always the current one. If lnum==0, current line is calculated, |
| | 459 | * specified line otherwise. |
| | 460 | */ |
| | 461 | int |
| | 462 | get_breakindent_win (wp,lnum) |
| | 463 | win_T* wp; |
| | 464 | linenr_T lnum; |
| | 465 | { |
| | 466 | int bri; |
| | 467 | /* window width minus barren space, i.e. what rests for text */ |
| | 468 | const int eff_wwidth = W_WIDTH(wp) |
| | 469 | - (wp->w_p_nu && !vim_strchr(p_cpo,CPO_NUMCOL)?number_width(wp):0); |
| | 470 | /* - (*p_sbr == NUL ? 0 : vim_strsize(p_sbr)); */ |
| | 471 | |
| | 472 | bri = get_indent_buf(wp->w_buffer,lnum?lnum:wp->w_cursor.lnum) + wp->w_p_brishift; |
| | 473 | |
| | 474 | /* if numbering and 'c' in 'cpoptions', cancel it out effectively */ |
| | 475 | /* (this could be replaced by an equivalent call to win_col_off2()) */ |
| | 476 | if (curwin->w_p_nu && vim_strchr(p_cpo, CPO_NUMCOL)) |
| | 477 | bri += number_width(wp); |
| | 478 | |
| | 479 | /* never indent past left window margin */ |
| | 480 | if (bri < 0) |
| | 481 | bri = 0; |
| | 482 | /* always leave at least bri_min characters on the left, |
| | 483 | * if text width is sufficient */ |
| | 484 | else if (bri > eff_wwidth - wp->w_p_brimin) |
| | 485 | bri = eff_wwidth - wp->w_p_brimin < 0 ? 0 : eff_wwidth - wp->w_p_brimin; |
| | 486 | |
| | 487 | return bri; |
| | 488 | } |
| | 489 | #endif |
| | 490 | |
| | 491 | |
| 454 | 492 | #if defined(FEAT_CINDENT) || defined(FEAT_SMARTINDENT) |
| 455 | 493 | |
| 456 | 494 | static int cin_is_cinword __ARGS((char_u *line)); |
| … |
… |
|
| 1732 | 1770 | s = ml_get_buf(wp->w_buffer, lnum, FALSE); |
| 1733 | 1771 | if (*s == NUL) /* empty line */ |
| 1734 | 1772 | return 1; |
| 1735 | | col = win_linetabsize(wp, s, (colnr_T)MAXCOL); |
| | 1773 | col = win_linetabsize(wp, s, (colnr_T)MAXCOL, lnum); |
| 1736 | 1774 | |
| 1737 | 1775 | /* |
| 1738 | 1776 | * If list mode is on, then the '$' at the end of the line may take up one |
| … |
… |
|
| 1788 | 1826 | col = 0; |
| 1789 | 1827 | while (*s != NUL && --column >= 0) |
| 1790 | 1828 | { |
| 1791 | | col += win_lbr_chartabsize(wp, s, (colnr_T)col, NULL); |
| | 1829 | col += win_lbr_chartabsize(wp, s, (colnr_T)col, NULL, lnum); |
| 1792 | 1830 | mb_ptr_adv(s); |
| 1793 | 1831 | } |
| 1794 | 1832 | |
| … |
… |
|
| 1800 | 1838 | * 'ts') -- webb. |
| 1801 | 1839 | */ |
| 1802 | 1840 | if (*s == TAB && (State & NORMAL) && (!wp->w_p_list || lcs_tab1)) |
| 1803 | | col += win_lbr_chartabsize(wp, s, (colnr_T)col, NULL) - 1; |
| | 1841 | col += win_lbr_chartabsize(wp, s, (colnr_T)col, NULL, lnum) - 1; |
| 1804 | 1842 | |
| 1805 | 1843 | /* |
| 1806 | 1844 | * Add column offset for 'number', 'relativenumber', 'foldcolumn', etc. |
| … |
… |
|
| 8316 | 8354 | amount = 0; |
| 8317 | 8355 | while (*that && col) |
| 8318 | 8356 | { |
| 8319 | | amount += lbr_chartabsize_adv(&that, (colnr_T)amount); |
| | 8357 | amount += lbr_chartabsize_adv(&that, (colnr_T)amount, pos->lnum); |
| 8320 | 8358 | col--; |
| 8321 | 8359 | } |
| 8322 | 8360 | |
| … |
… |
|
| 8339 | 8377 | |
| 8340 | 8378 | while (vim_iswhite(*that)) |
| 8341 | 8379 | { |
| 8342 | | amount += lbr_chartabsize(that, (colnr_T)amount); |
| | 8380 | amount += lbr_chartabsize(that, (colnr_T)amount, pos->lnum); |
| 8343 | 8381 | ++that; |
| 8344 | 8382 | } |
| 8345 | 8383 | |
| … |
… |
|
| 8378 | 8416 | --parencount; |
| 8379 | 8417 | if (*that == '\\' && *(that+1) != NUL) |
| 8380 | 8418 | amount += lbr_chartabsize_adv(&that, |
| 8381 | | (colnr_T)amount); |
| | 8419 | (colnr_T)amount, pos->lnum); |
| 8382 | 8420 | amount += lbr_chartabsize_adv(&that, |
| 8383 | | (colnr_T)amount); |
| | 8421 | (colnr_T)amount, pos->lnum); |
| 8384 | 8422 | } |
| 8385 | 8423 | } |
| 8386 | 8424 | while (vim_iswhite(*that)) |
| 8387 | 8425 | { |
| 8388 | | amount += lbr_chartabsize(that, (colnr_T)amount); |
| | 8426 | amount += lbr_chartabsize(that, (colnr_T)amount, pos->lnum); |
| 8389 | 8427 | that++; |
| 8390 | 8428 | } |
| 8391 | 8429 | if (!*that || *that == ';') |
-
diff -ru vim-7.3.000+hg~ee53a39d5896/src/misc2.c vim-7.3.000+hg~ee53a39d5896~bri/src/misc2.c
|
old
|
new
|
|
| 166 | 166 | #ifdef FEAT_VIRTUALEDIT |
| 167 | 167 | if ((addspaces || finetune) && !VIsual_active) |
| 168 | 168 | { |
| 169 | | curwin->w_curswant = linetabsize(line) + one_more; |
| | 169 | curwin->w_curswant = linetabsize(line, pos->lnum) + one_more; |
| 170 | 170 | if (curwin->w_curswant > 0) |
| 171 | 171 | --curwin->w_curswant; |
| 172 | 172 | } |
| … |
… |
|
| 184 | 184 | # endif |
| 185 | 185 | && wcol >= (colnr_T)width) |
| 186 | 186 | { |
| 187 | | csize = linetabsize(line); |
| | 187 | csize = linetabsize(line, pos->lnum); |
| 188 | 188 | if (csize > 0) |
| 189 | 189 | csize--; |
| 190 | 190 | |
| … |
… |
|
| 206 | 206 | { |
| 207 | 207 | /* Count a tab for what it's worth (if list mode not on) */ |
| 208 | 208 | #ifdef FEAT_LINEBREAK |
| 209 | | csize = win_lbr_chartabsize(curwin, ptr, col, &head); |
| | 209 | csize = win_lbr_chartabsize(curwin, ptr, col, &head, pos->lnum); |
| 210 | 210 | mb_ptr_adv(ptr); |
| 211 | 211 | #else |
| 212 | | csize = lbr_chartabsize_adv(&ptr, col); |
| | 212 | csize = lbr_chartabsize_adv(&ptr, col, pos->lnum); |
| 213 | 213 | #endif |
| 214 | 214 | col += csize; |
| 215 | 215 | } |
-
diff -ru vim-7.3.000+hg~ee53a39d5896/src/normal.c vim-7.3.000+hg~ee53a39d5896~bri/src/normal.c
|
old
|
new
|
|
| 4398 | 4398 | int dir; |
| 4399 | 4399 | long dist; |
| 4400 | 4400 | { |
| 4401 | | int linelen = linetabsize(ml_get_curline()); |
| | 4401 | int linelen = linetabsize(ml_get_curline(), curwin->w_cursor.lnum); |
| 4402 | 4402 | int retval = OK; |
| 4403 | 4403 | int atend = FALSE; |
| 4404 | 4404 | int n; |
| … |
… |
|
| 4471 | 4471 | (void)hasFolding(curwin->w_cursor.lnum, |
| 4472 | 4472 | &curwin->w_cursor.lnum, NULL); |
| 4473 | 4473 | #endif |
| 4474 | | linelen = linetabsize(ml_get_curline()); |
| | 4474 | linelen = linetabsize(ml_get_curline(), curwin->w_cursor.lnum); |
| 4475 | 4475 | if (linelen > width1) |
| 4476 | 4476 | curwin->w_curswant += (((linelen - width1 - 1) / width2) |
| 4477 | 4477 | + 1) * width2; |
-
Pouze v vim-7.3.000+hg~ee53a39d5896~bri/src: objects
diff -ru vim-7.3.000+hg~ee53a39d5896/src/ops.c vim-7.3.000+hg~ee53a39d5896~bri/src/ops.c
|
old
|
new
|
|
| 428 | 428 | } |
| 429 | 429 | for ( ; vim_iswhite(*bd.textstart); ) |
| 430 | 430 | { |
| 431 | | incr = lbr_chartabsize_adv(&bd.textstart, (colnr_T)(bd.start_vcol)); |
| | 431 | incr = lbr_chartabsize_adv(&bd.textstart, (colnr_T)(bd.start_vcol), curwin->w_cursor.lnum); |
| 432 | 432 | total += incr; |
| 433 | 433 | bd.start_vcol += incr; |
| 434 | 434 | } |
| … |
… |
|
| 488 | 488 | |
| 489 | 489 | while (vim_iswhite(*non_white)) |
| 490 | 490 | { |
| 491 | | incr = lbr_chartabsize_adv(&non_white, non_white_col); |
| | 491 | incr = lbr_chartabsize_adv(&non_white, non_white_col, curwin->w_cursor.lnum); |
| 492 | 492 | non_white_col += incr; |
| 493 | 493 | } |
| 494 | 494 | |
| … |
… |
|
| 513 | 513 | verbatim_copy_width -= bd.start_char_vcols; |
| 514 | 514 | while (verbatim_copy_width < destination_col) |
| 515 | 515 | { |
| 516 | | incr = lbr_chartabsize(verbatim_copy_end, verbatim_copy_width); |
| | 516 | incr = lbr_chartabsize(verbatim_copy_end, verbatim_copy_width, curwin->w_cursor.lnum); |
| 517 | 517 | if (verbatim_copy_width + incr > destination_col) |
| 518 | 518 | break; |
| 519 | 519 | verbatim_copy_width += incr; |
| … |
… |
|
| 3527 | 3527 | for (ptr = oldp; vcol < col && *ptr; ) |
| 3528 | 3528 | { |
| 3529 | 3529 | /* Count a tab for what it's worth (if list mode not on) */ |
| 3530 | | incr = lbr_chartabsize_adv(&ptr, (colnr_T)vcol); |
| | 3530 | incr = lbr_chartabsize_adv(&ptr, (colnr_T)vcol, lnum); |
| 3531 | 3531 | vcol += incr; |
| 3532 | 3532 | } |
| 3533 | 3533 | bd.textcol = (colnr_T)(ptr - oldp); |
| … |
… |
|
| 3561 | 3561 | /* calculate number of spaces required to fill right side of block*/ |
| 3562 | 3562 | spaces = y_width + 1; |
| 3563 | 3563 | for (j = 0; j < yanklen; j++) |
| 3564 | | spaces -= lbr_chartabsize(&y_array[i][j], 0); |
| | 3564 | spaces -= lbr_chartabsize(&y_array[i][j], 0, lnum); |
| 3565 | 3565 | if (spaces < 0) |
| 3566 | 3566 | spaces = 0; |
| 3567 | 3567 | |
| … |
… |
|
| 4917 | 4917 | while (bdp->start_vcol < oap->start_vcol && *pstart) |
| 4918 | 4918 | { |
| 4919 | 4919 | /* Count a tab for what it's worth (if list mode not on) */ |
| 4920 | | incr = lbr_chartabsize(pstart, (colnr_T)bdp->start_vcol); |
| | 4920 | incr = lbr_chartabsize(pstart, (colnr_T)bdp->start_vcol, lnum); |
| 4921 | 4921 | bdp->start_vcol += incr; |
| 4922 | 4922 | #ifdef FEAT_VISUALEXTRA |
| 4923 | 4923 | if (vim_iswhite(*pstart)) |
| … |
… |
|
| 4986 | 4986 | { |
| 4987 | 4987 | /* Count a tab for what it's worth (if list mode not on) */ |
| 4988 | 4988 | prev_pend = pend; |
| 4989 | | incr = lbr_chartabsize_adv(&pend, (colnr_T)bdp->end_vcol); |
| | 4989 | incr = lbr_chartabsize_adv(&pend, (colnr_T)bdp->end_vcol, lnum); |
| 4990 | 4990 | bdp->end_vcol += incr; |
| 4991 | 4991 | } |
| 4992 | 4992 | if (bdp->end_vcol <= oap->end_vcol |
| … |
… |
|
| 6476 | 6476 | validate_virtcol(); |
| 6477 | 6477 | col_print(buf1, sizeof(buf1), (int)curwin->w_cursor.col + 1, |
| 6478 | 6478 | (int)curwin->w_virtcol + 1); |
| 6479 | | col_print(buf2, sizeof(buf2), (int)STRLEN(p), linetabsize(p)); |
| | 6479 | col_print(buf2, sizeof(buf2), (int)STRLEN(p), linetabsize(p, curwin->w_cursor.lnum)); |
| 6480 | 6480 | |
| 6481 | 6481 | if (char_count_cursor == byte_count_cursor |
| 6482 | 6482 | && char_count == byte_count) |
-
diff -ru vim-7.3.000+hg~ee53a39d5896/src/option.c vim-7.3.000+hg~ee53a39d5896~bri/src/option.c
|
old
|
new
|
|
| 190 | 190 | #ifdef FEAT_ARABIC |
| 191 | 191 | # define PV_ARAB OPT_WIN(WV_ARAB) |
| 192 | 192 | #endif |
| | 193 | #ifdef FEAT_LINEBREAK |
| | 194 | # define PV_BRI OPT_WIN(WV_BRI) |
| | 195 | # define PV_BRIMIN OPT_WIN(WV_BRIMIN) |
| | 196 | # define PV_BRISHIFT OPT_WIN(WV_BRISHIFT) |
| | 197 | #endif |
| 193 | 198 | #ifdef FEAT_DIFF |
| 194 | 199 | # define PV_DIFF OPT_WIN(WV_DIFF) |
| 195 | 200 | #endif |
| … |
… |
|
| 650 | 655 | {(char_u *)0L, (char_u *)0L} |
| 651 | 656 | #endif |
| 652 | 657 | SCRIPTID_INIT}, |
| | 658 | {"breakindent", "bri", P_BOOL|P_VI_DEF|P_VIM|P_RWIN, |
| | 659 | #ifdef FEAT_LINEBREAK |
| | 660 | (char_u *)VAR_WIN, PV_BRI, |
| | 661 | {(char_u *)FALSE, (char_u *)0L} |
| | 662 | #else |
| | 663 | (char_u *)NULL, PV_NONE, |
| | 664 | {(char_u *)0L, (char_u *)0L} |
| | 665 | #endif |
| | 666 | SCRIPTID_INIT}, |
| | 667 | {"breakindentmin", "brimin", P_NUM|P_VI_DEF|P_VIM|P_RWIN, |
| | 668 | #ifdef FEAT_LINEBREAK |
| | 669 | (char_u *)VAR_WIN, PV_BRIMIN, |
| | 670 | {(char_u *)20L, (char_u *)20L} |
| | 671 | #else |
| | 672 | (char_u *)NULL, PV_NONE, |
| | 673 | {(char_u *)0L, (char_u *)0L} |
| | 674 | #endif |
| | 675 | SCRIPTID_INIT}, |
| | 676 | {"breakindentshift", "brishift", P_NUM|P_VI_DEF|P_VIM|P_RWIN, |
| | 677 | #ifdef FEAT_LINEBREAK |
| | 678 | (char_u *)VAR_WIN, PV_BRISHIFT, |
| | 679 | {(char_u *)0L, (char_u *)0L} |
| | 680 | #else |
| | 681 | (char_u *)NULL, PV_NONE, |
| | 682 | {(char_u *)0L, (char_u *)0L} |
| | 683 | #endif |
| | 684 | SCRIPTID_INIT}, |
| 653 | 685 | {"browsedir", "bsdir",P_STRING|P_VI_DEF, |
| 654 | 686 | #ifdef FEAT_BROWSE |
| 655 | 687 | (char_u *)&p_bsdir, PV_NONE, |
| … |
… |
|
| 8334 | 8366 | } |
| 8335 | 8367 | curwin->w_nrwidth_line_count = 0; |
| 8336 | 8368 | } |
| | 8369 | |
| | 8370 | /* 'breakindentmin' must be positive */ |
| | 8371 | else if (pp == &curwin->w_p_brimin) |
| | 8372 | { |
| | 8373 | if (curwin->w_p_brimin < 1) |
| | 8374 | { |
| | 8375 | errmsg = e_positive; |
| | 8376 | curwin->w_p_brimin = 1; |
| | 8377 | } |
| | 8378 | } |
| 8337 | 8379 | #endif |
| 8338 | 8380 | |
| 8339 | 8381 | else if (pp == &curbuf->b_p_tw) |
| … |
… |
|
| 9563 | 9605 | case PV_WRAP: return (char_u *)&(curwin->w_p_wrap); |
| 9564 | 9606 | #ifdef FEAT_LINEBREAK |
| 9565 | 9607 | case PV_LBR: return (char_u *)&(curwin->w_p_lbr); |
| | 9608 | case PV_BRI: return (char_u *)&(curwin->w_p_bri); |
| | 9609 | case PV_BRIMIN: return (char_u *)&(curwin->w_p_brimin); |
| | 9610 | case PV_BRISHIFT: return (char_u *)&(curwin->w_p_brishift); |
| 9566 | 9611 | #endif |
| 9567 | 9612 | #ifdef FEAT_SCROLLBIND |
| 9568 | 9613 | case PV_SCBIND: return (char_u *)&(curwin->w_p_scb); |
| … |
… |
|
| 9752 | 9797 | to->wo_wrap = from->wo_wrap; |
| 9753 | 9798 | #ifdef FEAT_LINEBREAK |
| 9754 | 9799 | to->wo_lbr = from->wo_lbr; |
| | 9800 | to->wo_bri = from->wo_bri; |
| | 9801 | to->wo_brimin = from->wo_brimin; |
| 9755 | 9802 | #endif |
| 9756 | 9803 | #ifdef FEAT_SCROLLBIND |
| 9757 | 9804 | to->wo_scb = from->wo_scb; |
-
diff -ru vim-7.3.000+hg~ee53a39d5896/src/option.h vim-7.3.000+hg~ee53a39d5896~bri/src/option.h
|
old
|
new
|
|
| 1039 | 1039 | #ifdef FEAT_CURSORBIND |
| 1040 | 1040 | , WV_CRBIND |
| 1041 | 1041 | #endif |
| | 1042 | #ifdef FEAT_LINEBREAK |
| | 1043 | , WV_BRI |
| | 1044 | , WV_BRIMIN |
| | 1045 | , WV_BRISHIFT |
| | 1046 | #endif |
| 1042 | 1047 | #ifdef FEAT_DIFF |
| 1043 | 1048 | , WV_DIFF |
| 1044 | 1049 | #endif |
-
diff -ru vim-7.3.000+hg~ee53a39d5896/src/proto/charset.pro vim-7.3.000+hg~ee53a39d5896~bri/src/proto/charset.pro
|
old
|
new
|
|
| 14 | 14 | int vim_strsize __ARGS((char_u *s)); |
| 15 | 15 | int vim_strnsize __ARGS((char_u *s, int len)); |
| 16 | 16 | int chartabsize __ARGS((char_u *p, colnr_T col)); |
| 17 | | int linetabsize __ARGS((char_u *s)); |
| 18 | | int linetabsize_col __ARGS((int startcol, char_u *s)); |
| 19 | | int win_linetabsize __ARGS((win_T *wp, char_u *p, colnr_T len)); |
| | 17 | int linetabsize __ARGS((char_u *s, linenr_T lnum)); |
| | 18 | int linetabsize_col __ARGS((int startcol, char_u *s, linenr_T lnum)); |
| | 19 | int win_linetabsize __ARGS((win_T *wp, char_u *p, colnr_T len, linenr_T lnum)); |
| 20 | 20 | int vim_isIDc __ARGS((int c)); |
| 21 | 21 | int vim_iswordc __ARGS((int c)); |
| 22 | 22 | int vim_iswordp __ARGS((char_u *p)); |
| … |
… |
|
| 25 | 25 | int vim_isfilec_or_wc __ARGS((int c)); |
| 26 | 26 | int vim_isprintc __ARGS((int c)); |
| 27 | 27 | int vim_isprintc_strict __ARGS((int c)); |
| 28 | | int lbr_chartabsize __ARGS((unsigned char *s, colnr_T col)); |
| 29 | | int lbr_chartabsize_adv __ARGS((char_u **s, colnr_T col)); |
| 30 | | int win_lbr_chartabsize __ARGS((win_T *wp, char_u *s, colnr_T col, int *headp)); |
| | 28 | int lbr_chartabsize __ARGS((unsigned char *s, colnr_T col, linenr_T lnum)); |
| | 29 | int lbr_chartabsize_adv __ARGS((char_u **s, colnr_T col, linenr_T lnum)); |
| | 30 | int win_lbr_chartabsize __ARGS((win_T *wp, char_u *s, colnr_T col, int *headp, linenr_T lnum)); |
| 31 | 31 | int in_win_border __ARGS((win_T *wp, colnr_T vcol)); |
| 32 | 32 | void getvcol __ARGS((win_T *wp, pos_T *pos, colnr_T *start, colnr_T *cursor, colnr_T *end)); |
| 33 | 33 | colnr_T getvcol_nolist __ARGS((pos_T *posp)); |
-
diff -ru vim-7.3.000+hg~ee53a39d5896/src/proto/misc1.pro vim-7.3.000+hg~ee53a39d5896~bri/src/proto/misc1.pro
|
old
|
new
|
|
| 5 | 5 | int get_indent_str __ARGS((char_u *ptr, int ts)); |
| 6 | 6 | int set_indent __ARGS((int size, int flags)); |
| 7 | 7 | int get_number_indent __ARGS((linenr_T lnum)); |
| | 8 | int get_breakindent_win __ARGS((win_T *wp, linenr_T lnum)); |
| 8 | 9 | int open_line __ARGS((int dir, int flags, int old_indent)); |
| 9 | 10 | int get_leader_len __ARGS((char_u *line, char_u **flags, int backward)); |
| 10 | 11 | int plines __ARGS((linenr_T lnum)); |
-
diff -ru vim-7.3.000+hg~ee53a39d5896/src/regexp.c vim-7.3.000+hg~ee53a39d5896~bri/src/regexp.c
|
old
|
new
|
|
| 4035 | 4035 | if (top.col == MAXCOL || bot.col == MAXCOL) |
| 4036 | 4036 | end = MAXCOL; |
| 4037 | 4037 | cols = win_linetabsize(wp, |
| 4038 | | regline, (colnr_T)(reginput - regline)); |
| | 4038 | regline, (colnr_T)(reginput - regline), reglnum + reg_firstlnum); |
| 4039 | 4039 | if (cols < start || cols > end - (*p_sel == 'e')) |
| 4040 | 4040 | status = RA_NOMATCH; |
| 4041 | 4041 | } |
| … |
… |
|
| 4059 | 4059 | case RE_VCOL: |
| 4060 | 4060 | if (!re_num_cmp((long_u)win_linetabsize( |
| 4061 | 4061 | reg_win == NULL ? curwin : reg_win, |
| 4062 | | regline, (colnr_T)(reginput - regline)) + 1, scan)) |
| | 4062 | regline, (colnr_T)(reginput - regline), reglnum + reg_firstlnum ) + 1, scan)) |
| 4063 | 4063 | status = RA_NOMATCH; |
| 4064 | 4064 | break; |
| 4065 | 4065 | |
-
diff -ru vim-7.3.000+hg~ee53a39d5896/src/screen.c vim-7.3.000+hg~ee53a39d5896~bri/src/screen.c
|
old
|
new
|
|
| 2802 | 2802 | # define WL_SIGN WL_FOLD /* column for signs */ |
| 2803 | 2803 | #endif |
| 2804 | 2804 | #define WL_NR WL_SIGN + 1 /* line number */ |
| | 2805 | #ifdef FEAT_LINEBREAK |
| | 2806 | # define WL_BRI WL_NR + 1 /* 'breakindent' */ |
| | 2807 | #else |
| | 2808 | # define WL_BRI WL_NR |
| | 2809 | #endif |
| 2805 | 2810 | #if defined(FEAT_LINEBREAK) || defined(FEAT_DIFF) |
| 2806 | | # define WL_SBR WL_NR + 1 /* 'showbreak' or 'diff' */ |
| | 2811 | # define WL_SBR WL_BRI + 1 /* 'showbreak' or 'diff' */ |
| 2807 | 2812 | #else |
| 2808 | | # define WL_SBR WL_NR |
| | 2813 | # define WL_SBR WL_BRI |
| 2809 | 2814 | #endif |
| 2810 | 2815 | #define WL_LINE WL_SBR + 1 /* text in the line */ |
| 2811 | 2816 | int draw_state = WL_START; /* what to draw next */ |
| … |
… |
|
| 3133 | 3138 | #endif |
| 3134 | 3139 | while (vcol < v && *ptr != NUL) |
| 3135 | 3140 | { |
| 3136 | | c = win_lbr_chartabsize(wp, ptr, (colnr_T)vcol, NULL); |
| | 3141 | c = win_lbr_chartabsize(wp, ptr, (colnr_T)vcol, NULL, lnum); |
| 3137 | 3142 | vcol += c; |
| 3138 | 3143 | #ifdef FEAT_MBYTE |
| 3139 | 3144 | prev_ptr = ptr; |
| … |
… |
|
| 3503 | 3508 | } |
| 3504 | 3509 | } |
| 3505 | 3510 | |
| | 3511 | #ifdef FEAT_LINEBREAK |
| | 3512 | /* draw 'breakindent': indent wrapped text accordingly */ |
| | 3513 | if (draw_state == WL_BRI -1 && n_extra == 0){ |
| | 3514 | draw_state = WL_BRI; |
| | 3515 | # ifdef FEAT_DIFF |
| | 3516 | /* FIXME: handle (filler_todo > 0): or modify showbreak so that ---- lines are shorter by the amount needed? */ |
| | 3517 | # endif |
| | 3518 | if (wp->w_p_bri && row != startrow){ /* FIXME: what is startrow? Don't we need it as well?? */ |
| | 3519 | p_extra = NUL; |
| | 3520 | c_extra = ' '; |
| | 3521 | n_extra = get_breakindent_win(wp,lnum); |
| | 3522 | char_attr = 0; /* was: hl_attr(HLF_AT); */ |
| | 3523 | /* FIXME: why do we need to adjust vcol if showbreak does not?? */ |
| | 3524 | // vcol += n_extra; |
| | 3525 | /* FIXME: is this relevant here? copied shamelessly from showbreak */ |
| | 3526 | /* Correct end of highlighted area for 'breakindent', |
| | 3527 | * required when 'linebreak' is also set. */ |
| | 3528 | if (tocol == vcol) |
| | 3529 | tocol += n_extra; |
| | 3530 | } |
| | 3531 | } |
| | 3532 | #endif |
| | 3533 | |
| | 3534 | |
| 3506 | 3535 | #if defined(FEAT_LINEBREAK) || defined(FEAT_DIFF) |
| 3507 | 3536 | if (draw_state == WL_SBR - 1 && n_extra == 0) |
| 3508 | 3537 | { |
| … |
… |
|
| 4209 | 4238 | # ifdef FEAT_MBYTE |
| 4210 | 4239 | has_mbyte ? mb_l : |
| 4211 | 4240 | # endif |
| 4212 | | 1), (colnr_T)vcol, NULL) - 1; |
| | 4241 | 1), (colnr_T)vcol, NULL, lnum) - 1; |
| 4213 | 4242 | c_extra = ' '; |
| 4214 | 4243 | if (vim_iswhite(c)) |
| 4215 | 4244 | c = ' '; |
-
diff -ru vim-7.3.000+hg~ee53a39d5896/src/structs.h vim-7.3.000+hg~ee53a39d5896~bri/src/structs.h
|
old
|
new
|
|
| 133 | 133 | int wo_arab; |
| 134 | 134 | # define w_p_arab w_onebuf_opt.wo_arab /* 'arabic' */ |
| 135 | 135 | #endif |
| | 136 | #ifdef FEAT_LINEBREAK |
| | 137 | int wo_bri; |
| | 138 | # define w_p_bri w_onebuf_opt.wo_bri /* 'breakindent' */ |
| | 139 | long wo_brimin; |
| | 140 | # define w_p_brimin w_onebuf_opt.wo_brimin /* 'breakindentmin' */ |
| | 141 | long wo_brishift; |
| | 142 | # define w_p_brishift w_onebuf_opt.wo_brishift /* 'breakindentshift' */ |
| | 143 | #endif |
| 136 | 144 | #ifdef FEAT_DIFF |
| 137 | 145 | int wo_diff; |
| 138 | 146 | # define w_p_diff w_onebuf_opt.wo_diff /* 'diff' */ |
-
diff -ru vim-7.3.000+hg~ee53a39d5896/src/ui.c vim-7.3.000+hg~ee53a39d5896~bri/src/ui.c
|
old
|
new
|
|
| 3066 | 3066 | start = ptr = ml_get_buf(wp->w_buffer, lnum, FALSE); |
| 3067 | 3067 | while (count <= vcol && *ptr != NUL) |
| 3068 | 3068 | { |
| 3069 | | count += win_lbr_chartabsize(wp, ptr, count, NULL); |
| | 3069 | count += win_lbr_chartabsize(wp, ptr, count, NULL, lnum); |
| 3070 | 3070 | mb_ptr_adv(ptr); |
| 3071 | 3071 | } |
| 3072 | 3072 | return (int)(ptr - start); |