summaryrefslogtreecommitdiff
path: root/src/screen.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2012-12-05 15:32:30 +0100
committerBram Moolenaar <Bram@vim.org>2012-12-05 15:32:30 +0100
commit0f9d0869c7acd08a4dc9bb4ac84c9c7c4e9f079b (patch)
tree962e52b4cdcfcdc42f1eae55789f385b6619961f /src/screen.c
parent81484f421553639a719db996bb83e52ea43792c9 (diff)
downloadvim-0f9d0869c7acd08a4dc9bb4ac84c9c7c4e9f079b.zip
updated for version 7.3.747
Problem: When characters are concealed text aligned with tabs are no longer aligned, e.g. at ":help :index". Solution: Compensate space for tabs for concealed characters. (Dominique Pelle)
Diffstat (limited to 'src/screen.c')
-rw-r--r--src/screen.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/screen.c b/src/screen.c
index 0e76d8cef..438627ace 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -4269,7 +4269,20 @@ win_line(wp, lnum, startrow, endrow, nochange)
{
/* tab amount depends on current column */
n_extra = (int)wp->w_buffer->b_p_ts
- - VCOL_HLC % (int)wp->w_buffer->b_p_ts - 1;
+ - vcol % (int)wp->w_buffer->b_p_ts - 1;
+#ifdef FEAT_CONCEAL
+ /* Tab alignment should be identical regardless of
+ * 'conceallevel' value. So tab compensates of all
+ * previous concealed characters, and thus resets vcol_off
+ * and boguscols accumulated so far in the line. Note that
+ * the tab can be longer than 'tabstop' when there
+ * are concealed characters. */
+ n_extra += vcol_off;
+ vcol -= vcol_off;
+ vcol_off = 0;
+ col -= boguscols;
+ boguscols = 0;
+#endif
#ifdef FEAT_MBYTE
mb_utf8 = FALSE; /* don't draw as UTF-8 */
#endif