aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/misc1.c
diff options
context:
space:
mode:
authorFelipe Morales <hel.sheep@gmail.com>2014-06-26 00:21:57 -0400
committerFelipe Morales <hel.sheep@gmail.com>2014-08-20 05:19:49 -0400
commit47391b18e2084f2747b10aa6158bc40e03f01528 (patch)
treec4964c57901313d4067f80325d320cc94a579b49 /src/nvim/misc1.c
parentbbefc73c553d681f78f40df9d97ec89ae9b06520 (diff)
downloadrneovim-47391b18e2084f2747b10aa6158bc40e03f01528.tar.gz
rneovim-47391b18e2084f2747b10aa6158bc40e03f01528.tar.bz2
rneovim-47391b18e2084f2747b10aa6158bc40e03f01528.zip
Port vim's patch 7.4.338 ('breakindent')
Diffstat (limited to 'src/nvim/misc1.c')
-rw-r--r--src/nvim/misc1.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c
index f0c4ee492e..986374b352 100644
--- a/src/nvim/misc1.c
+++ b/src/nvim/misc1.c
@@ -194,7 +194,7 @@ open_line (
/*
* count white space on current line
*/
- newindent = get_indent_str(saved_line, (int)curbuf->b_p_ts);
+ newindent = get_indent_str(saved_line, (int)curbuf->b_p_ts, FALSE);
if (newindent == 0 && !(flags & OPENLINE_COM_LIST))
newindent = second_line_indent; /* for ^^D command in insert mode */
@@ -631,7 +631,7 @@ open_line (
if (curbuf->b_p_ai
|| do_si
)
- newindent = get_indent_str(leader, (int)curbuf->b_p_ts);
+ newindent = get_indent_str(leader, (int)curbuf->b_p_ts, FALSE);
/* Add the indent offset */
if (newindent + off < 0) {
@@ -1306,6 +1306,7 @@ int plines_win_col(win_T *wp, linenr_T lnum, long column)
char_u *s;
int lines = 0;
int width;
+ char_u *line;
/* Check for filler lines above this buffer line. When folded the result
* is one line anyway. */
@@ -1317,11 +1318,11 @@ int plines_win_col(win_T *wp, linenr_T lnum, long column)
if (wp->w_width == 0)
return lines + 1;
- s = ml_get_buf(wp->w_buffer, lnum, FALSE);
+ line = s = ml_get_buf(wp->w_buffer, lnum, FALSE);
col = 0;
while (*s != NUL && --column >= 0) {
- col += win_lbr_chartabsize(wp, s, (colnr_T)col, NULL);
+ col += win_lbr_chartabsize(wp, line, s, (colnr_T)col, NULL);
mb_ptr_adv(s);
}
@@ -1333,7 +1334,7 @@ int plines_win_col(win_T *wp, linenr_T lnum, long column)
* 'ts') -- webb.
*/
if (*s == TAB && (State & NORMAL) && (!wp->w_p_list || lcs_tab1))
- col += win_lbr_chartabsize(wp, s, (colnr_T)col, NULL) - 1;
+ col += win_lbr_chartabsize(wp, line, s, (colnr_T)col, NULL) - 1;
/*
* Add column offset for 'number', 'relativenumber', 'foldcolumn', etc.