Mercurial > vim
comparison src/misc1.c @ 12515:972ea22c946f v8.0.1136
patch 8.0.1136: W_WIDTH() is always the same
commit https://github.com/vim/vim/commit/0263146b5dbbb6c120ce2e7720256503b864425d
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Sep 22 15:20:32 2017 +0200
patch 8.0.1136: W_WIDTH() is always the same
Problem: W_WIDTH() is always the same.
Solution: Expand the macro.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 22 Sep 2017 15:30:06 +0200 |
parents | 68d7bc045dbe |
children | fad36581f788 |
comparison
equal
deleted
inserted
replaced
12514:55f1b7ff0467 | 12515:972ea22c946f |
---|---|
493 static long prev_ts = 0L; /* cached tabstop value */ | 493 static long prev_ts = 0L; /* cached tabstop value */ |
494 static char_u *prev_line = NULL; /* cached pointer to line */ | 494 static char_u *prev_line = NULL; /* cached pointer to line */ |
495 static varnumber_T prev_tick = 0; /* changedtick of cached value */ | 495 static varnumber_T prev_tick = 0; /* changedtick of cached value */ |
496 int bri = 0; | 496 int bri = 0; |
497 /* window width minus window margin space, i.e. what rests for text */ | 497 /* window width minus window margin space, i.e. what rests for text */ |
498 const int eff_wwidth = W_WIDTH(wp) | 498 const int eff_wwidth = wp->w_width |
499 - ((wp->w_p_nu || wp->w_p_rnu) | 499 - ((wp->w_p_nu || wp->w_p_rnu) |
500 && (vim_strchr(p_cpo, CPO_NUMCOL) == NULL) | 500 && (vim_strchr(p_cpo, CPO_NUMCOL) == NULL) |
501 ? number_width(wp) + 1 : 0); | 501 ? number_width(wp) + 1 : 0); |
502 | 502 |
503 /* used cached indent, unless pointer or 'tabstop' changed */ | 503 /* used cached indent, unless pointer or 'tabstop' changed */ |
2024 col += 1; | 2024 col += 1; |
2025 | 2025 |
2026 /* | 2026 /* |
2027 * Add column offset for 'number', 'relativenumber' and 'foldcolumn'. | 2027 * Add column offset for 'number', 'relativenumber' and 'foldcolumn'. |
2028 */ | 2028 */ |
2029 width = W_WIDTH(wp) - win_col_off(wp); | 2029 width = wp->w_width - win_col_off(wp); |
2030 if (width <= 0) | 2030 if (width <= 0) |
2031 return 32000; | 2031 return 32000; |
2032 if (col <= width) | 2032 if (col <= width) |
2033 return 1; | 2033 return 1; |
2034 col -= width; | 2034 col -= width; |
2081 col += win_lbr_chartabsize(wp, line, s, (colnr_T)col, NULL) - 1; | 2081 col += win_lbr_chartabsize(wp, line, s, (colnr_T)col, NULL) - 1; |
2082 | 2082 |
2083 /* | 2083 /* |
2084 * Add column offset for 'number', 'relativenumber', 'foldcolumn', etc. | 2084 * Add column offset for 'number', 'relativenumber', 'foldcolumn', etc. |
2085 */ | 2085 */ |
2086 width = W_WIDTH(wp) - win_col_off(wp); | 2086 width = wp->w_width - win_col_off(wp); |
2087 if (width <= 0) | 2087 if (width <= 0) |
2088 return 9999; | 2088 return 9999; |
2089 | 2089 |
2090 lines += 1; | 2090 lines += 1; |
2091 if (col > width) | 2091 if (col > width) |