Mercurial > vim
comparison src/edit.c @ 5438:878ed73c7070 v7.4.069
updated for version 7.4.069
Problem: Cannot right shift lines starting with #.
Solution: Allow the right shift when 'cino' contains #N with N > 0.
(Christian Brabandt)
Refactor parsing 'cino', store the values in the buffer.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Tue, 05 Nov 2013 07:13:41 +0100 |
parents | 86bf09a1b6d0 |
children | faf7e86203b5 |
comparison
equal
deleted
inserted
replaced
5437:7772f379c73d | 5438:878ed73c7070 |
---|---|
8956 colnr_T want_vcol; | 8956 colnr_T want_vcol; |
8957 colnr_T start_vcol; | 8957 colnr_T start_vcol; |
8958 | 8958 |
8959 *inserted_space_p = FALSE; | 8959 *inserted_space_p = FALSE; |
8960 if (p_sta && in_indent) | 8960 if (p_sta && in_indent) |
8961 ts = (int)get_sw_value(); | 8961 ts = (int)get_sw_value(curbuf); |
8962 else | 8962 else |
8963 ts = (int)get_sts_value(); | 8963 ts = (int)get_sts_value(); |
8964 /* Compute the virtual column where we want to be. Since | 8964 /* Compute the virtual column where we want to be. Since |
8965 * 'showbreak' may get in the way, need to get the last column of | 8965 * 'showbreak' may get in the way, need to get the last column of |
8966 * the previous character. */ | 8966 * the previous character. */ |
9645 | 9645 |
9646 /* | 9646 /* |
9647 * When nothing special, insert TAB like a normal character | 9647 * When nothing special, insert TAB like a normal character |
9648 */ | 9648 */ |
9649 if (!curbuf->b_p_et | 9649 if (!curbuf->b_p_et |
9650 && !(p_sta && ind && curbuf->b_p_ts != get_sw_value()) | 9650 && !(p_sta && ind && curbuf->b_p_ts != get_sw_value(curbuf)) |
9651 && get_sts_value() == 0) | 9651 && get_sts_value() == 0) |
9652 return TRUE; | 9652 return TRUE; |
9653 | 9653 |
9654 if (stop_arrow() == FAIL) | 9654 if (stop_arrow() == FAIL) |
9655 return TRUE; | 9655 return TRUE; |
9661 can_si_back = FALSE; | 9661 can_si_back = FALSE; |
9662 #endif | 9662 #endif |
9663 AppendToRedobuff((char_u *)"\t"); | 9663 AppendToRedobuff((char_u *)"\t"); |
9664 | 9664 |
9665 if (p_sta && ind) /* insert tab in indent, use 'shiftwidth' */ | 9665 if (p_sta && ind) /* insert tab in indent, use 'shiftwidth' */ |
9666 temp = (int)get_sw_value(); | 9666 temp = (int)get_sw_value(curbuf); |
9667 else if (curbuf->b_p_sts != 0) /* use 'softtabstop' when set */ | 9667 else if (curbuf->b_p_sts != 0) /* use 'softtabstop' when set */ |
9668 temp = (int)get_sts_value(); | 9668 temp = (int)get_sts_value(); |
9669 else /* otherwise use 'tabstop' */ | 9669 else /* otherwise use 'tabstop' */ |
9670 temp = (int)curbuf->b_p_ts; | 9670 temp = (int)curbuf->b_p_ts; |
9671 temp -= get_nolist_virtcol() % temp; | 9671 temp -= get_nolist_virtcol() % temp; |