Mirror of the Vim source from https://github.com/vim/vim
Révision | ee9d2d24ea9bd0a7d500f1c37cbea802d8d1d88c (tree) |
---|---|
l'heure | 2008-01-17 04:03:13 |
Auteur | vimboss |
Commiter | vimboss |
updated for version 7.1-231
@@ -1662,11 +1662,12 @@ | ||
1662 | 1662 | * if round is TRUE, round the indent to 'shiftwidth' (only with _INC and _Dec). |
1663 | 1663 | */ |
1664 | 1664 | void |
1665 | -change_indent(type, amount, round, replaced) | |
1665 | +change_indent(type, amount, round, replaced, call_changed_bytes) | |
1666 | 1666 | int type; |
1667 | 1667 | int amount; |
1668 | 1668 | int round; |
1669 | 1669 | int replaced; /* replaced character, put on replace stack */ |
1670 | + int call_changed_bytes; /* call changed_bytes() */ | |
1670 | 1671 | { |
1671 | 1672 | int vcol; |
1672 | 1673 | int last_vcol; |
@@ -1723,7 +1724,7 @@ | ||
1723 | 1724 | * Set the new indent. The cursor will be put on the first non-blank. |
1724 | 1725 | */ |
1725 | 1726 | if (type == INDENT_SET) |
1726 | - (void)set_indent(amount, SIN_CHANGED); | |
1727 | + (void)set_indent(amount, call_changed_bytes ? SIN_CHANGED : 0); | |
1727 | 1728 | else |
1728 | 1729 | { |
1729 | 1730 | #ifdef FEAT_VREPLACE |
@@ -1733,7 +1734,7 @@ | ||
1733 | 1734 | if (State & VREPLACE_FLAG) |
1734 | 1735 | State = INSERT; |
1735 | 1736 | #endif |
1736 | - shift_line(type == INDENT_DEC, round, 1); | |
1737 | + shift_line(type == INDENT_DEC, round, 1, call_changed_bytes); | |
1737 | 1738 | #ifdef FEAT_VREPLACE |
1738 | 1739 | State = save_State; |
1739 | 1740 | #endif |
@@ -5921,7 +5922,7 @@ | ||
5921 | 5922 | { |
5922 | 5923 | #ifdef FEAT_VREPLACE |
5923 | 5924 | if (State & VREPLACE_FLAG) |
5924 | - change_indent(INDENT_SET, second_indent, FALSE, NUL); | |
5925 | + change_indent(INDENT_SET, second_indent, FALSE, NUL, TRUE); | |
5925 | 5926 | else |
5926 | 5927 | #endif |
5927 | 5928 | (void)set_indent(second_indent, SIN_CHANGED); |
@@ -7227,7 +7228,7 @@ | ||
7227 | 7228 | fixthisline(get_the_indent) |
7228 | 7229 | int (*get_the_indent) __ARGS((void)); |
7229 | 7230 | { |
7230 | - change_indent(INDENT_SET, get_the_indent(), FALSE, 0); | |
7231 | + change_indent(INDENT_SET, get_the_indent(), FALSE, 0, TRUE); | |
7231 | 7232 | if (linewhite(curwin->w_cursor.lnum)) |
7232 | 7233 | did_ai = TRUE; /* delete the indent if the line stays empty */ |
7233 | 7234 | } |
@@ -8170,10 +8171,10 @@ | ||
8170 | 8171 | replace_pop_ins(); |
8171 | 8172 | if (lastc == '^') |
8172 | 8173 | old_indent = get_indent(); /* remember curr. indent */ |
8173 | - change_indent(INDENT_SET, 0, TRUE, 0); | |
8174 | + change_indent(INDENT_SET, 0, TRUE, 0, TRUE); | |
8174 | 8175 | } |
8175 | 8176 | else |
8176 | - change_indent(c == Ctrl_D ? INDENT_DEC : INDENT_INC, 0, TRUE, 0); | |
8177 | + change_indent(c == Ctrl_D ? INDENT_DEC : INDENT_INC, 0, TRUE, 0, TRUE); | |
8177 | 8178 | |
8178 | 8179 | if (did_ai && *skipwhite(ml_get_curline()) != NUL) |
8179 | 8180 | did_ai = FALSE; |
@@ -9633,7 +9634,7 @@ | ||
9633 | 9634 | curwin->w_cursor = old_pos; |
9634 | 9635 | #ifdef FEAT_VREPLACE |
9635 | 9636 | if (State & VREPLACE_FLAG) |
9636 | - change_indent(INDENT_SET, i, FALSE, NUL); | |
9637 | + change_indent(INDENT_SET, i, FALSE, NUL, TRUE); | |
9637 | 9638 | else |
9638 | 9639 | #endif |
9639 | 9640 | (void)set_indent(i, SIN_CHANGED); |
@@ -9662,7 +9663,7 @@ | ||
9662 | 9663 | curwin->w_cursor = old_pos; |
9663 | 9664 | } |
9664 | 9665 | if (temp) |
9665 | - shift_line(TRUE, FALSE, 1); | |
9666 | + shift_line(TRUE, FALSE, 1, TRUE); | |
9666 | 9667 | } |
9667 | 9668 | } |
9668 | 9669 |
@@ -258,7 +258,7 @@ | ||
258 | 258 | if (first_char != '#' || !preprocs_left()) |
259 | 259 | #endif |
260 | 260 | { |
261 | - shift_line(oap->op_type == OP_LSHIFT, p_sr, amount); | |
261 | + shift_line(oap->op_type == OP_LSHIFT, p_sr, amount, FALSE); | |
262 | 262 | } |
263 | 263 | ++curwin->w_cursor.lnum; |
264 | 264 | } |
@@ -321,10 +321,11 @@ | ||
321 | 321 | * leaves cursor on first blank in the line |
322 | 322 | */ |
323 | 323 | void |
324 | -shift_line(left, round, amount) | |
324 | +shift_line(left, round, amount, call_changed_bytes) | |
325 | 325 | int left; |
326 | 326 | int round; |
327 | 327 | int amount; |
328 | + int call_changed_bytes; /* call changed_bytes() */ | |
328 | 329 | { |
329 | 330 | int count; |
330 | 331 | int i, j; |
@@ -363,10 +364,10 @@ | ||
363 | 364 | /* Set new indent */ |
364 | 365 | #ifdef FEAT_VREPLACE |
365 | 366 | if (State & VREPLACE_FLAG) |
366 | - change_indent(INDENT_SET, count, FALSE, NUL); | |
367 | + change_indent(INDENT_SET, count, FALSE, NUL, call_changed_bytes); | |
367 | 368 | else |
368 | 369 | #endif |
369 | - (void)set_indent(count, SIN_CHANGED); | |
370 | + (void)set_indent(count, call_changed_bytes ? SIN_CHANGED : 0); | |
370 | 371 | } |
371 | 372 | |
372 | 373 | #if defined(FEAT_VISUALEXTRA) || defined(PROTO) |
@@ -3,7 +3,7 @@ | ||
3 | 3 | void edit_putchar __ARGS((int c, int highlight)); |
4 | 4 | void edit_unputchar __ARGS((void)); |
5 | 5 | void display_dollar __ARGS((colnr_T col)); |
6 | -void change_indent __ARGS((int type, int amount, int round, int replaced)); | |
6 | +void change_indent __ARGS((int type, int amount, int round, int replaced, int call_changed_bytes)); | |
7 | 7 | void truncate_spaces __ARGS((char_u *line)); |
8 | 8 | void backspace_until_column __ARGS((int col)); |
9 | 9 | int vim_is_ctrl_x_key __ARGS((int c)); |
@@ -4,7 +4,7 @@ | ||
4 | 4 | int get_op_char __ARGS((int optype)); |
5 | 5 | int get_extra_op_char __ARGS((int optype)); |
6 | 6 | void op_shift __ARGS((oparg_T *oap, int curs_top, int amount)); |
7 | -void shift_line __ARGS((int left, int round, int amount)); | |
7 | +void shift_line __ARGS((int left, int round, int amount, int call_changed_bytes)); | |
8 | 8 | void op_reindent __ARGS((oparg_T *oap, int (*how)(void))); |
9 | 9 | int get_expr_register __ARGS((void)); |
10 | 10 | void set_expr_line __ARGS((char_u *new_line)); |
@@ -667,6 +667,8 @@ | ||
667 | 667 | static int included_patches[] = |
668 | 668 | { /* Add new patch number below this line */ |
669 | 669 | /**/ |
670 | + 231, | |
671 | +/**/ | |
670 | 672 | 230, |
671 | 673 | /**/ |
672 | 674 | 229, |