From 93bf201119f68b0723ee3f240afa48134cc41399 Mon Sep 17 00:00:00 2001 From: Felipe Oliveira Carvalho Date: Wed, 22 Apr 2015 19:12:26 -0300 Subject: Replace vim_iswhite with ascii_iswhite() defined in ascii.h --- src/nvim/indent.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/nvim/indent.c') diff --git a/src/nvim/indent.c b/src/nvim/indent.c index 183456d3f7..c1733346fc 100644 --- a/src/nvim/indent.c +++ b/src/nvim/indent.c @@ -118,7 +118,7 @@ int set_indent(int size, int flags) ind_done = 0; // Count as many characters as we can use. - while (todo > 0 && vim_iswhite(*p)) { + while (todo > 0 && ascii_iswhite(*p)) { if (*p == TAB) { tab_pad = (int)curbuf->b_p_ts - (ind_done % (int)curbuf->b_p_ts); @@ -183,7 +183,7 @@ int set_indent(int size, int flags) } // Return if the indent is OK already. - if (!doit && !vim_iswhite(*p) && !(flags & SIN_INSERT)) { + if (!doit && !ascii_iswhite(*p) && !(flags & SIN_INSERT)) { return false; } @@ -216,7 +216,7 @@ int set_indent(int size, int flags) // Skip over any additional white space (useful when newindent is less // than old). - while (vim_iswhite(*p)) { + while (ascii_iswhite(*p)) { p++; } } else { @@ -235,7 +235,7 @@ int set_indent(int size, int flags) p = oldline; ind_done = 0; - while (todo > 0 && vim_iswhite(*p)) { + while (todo > 0 && ascii_iswhite(*p)) { if (*p == TAB) { tab_pad = (int)curbuf->b_p_ts - (ind_done % (int)curbuf->b_p_ts); @@ -328,7 +328,7 @@ int copy_indent(int size, char_u *src) s = src; // Count/copy the usable portion of the source line. - while (todo > 0 && vim_iswhite(*s)) { + while (todo > 0 && ascii_iswhite(*s)) { if (*s == TAB) { tab_pad = (int)curbuf->b_p_ts - (ind_done % (int)curbuf->b_p_ts); @@ -502,7 +502,7 @@ int inindent(int extra) char_u *ptr; colnr_T col; - for (col = 0, ptr = get_cursor_line_ptr(); vim_iswhite(*ptr); ++col) { + for (col = 0, ptr = get_cursor_line_ptr(); ascii_iswhite(*ptr); ++col) { ptr++; } @@ -688,7 +688,7 @@ int get_lisp_indent(void) amount++; firsttry = amount; - while (vim_iswhite(*that)) { + while (ascii_iswhite(*that)) { amount += lbr_chartabsize(line, that, (colnr_T)amount); that++; } @@ -706,7 +706,7 @@ int get_lisp_indent(void) if (vi_lisp || ((*that != '"') && (*that != '\'') && (*that != '#') && ((*that < '0') || (*that > '9')))) { - while (*that && (!vim_iswhite(*that) || quotecount || parencount) + while (*that && (!ascii_iswhite(*that) || quotecount || parencount) && (!((*that == '(' || *that == '[') && !quotecount && !parencount && vi_lisp))) { if (*that == '"') { @@ -726,7 +726,7 @@ int get_lisp_indent(void) } } - while (vim_iswhite(*that)) { + while (ascii_iswhite(*that)) { amount += lbr_chartabsize(line, that, (colnr_T)amount); that++; } -- cgit From c96b933acc4d9ec7382d451055e44c85959772b9 Mon Sep 17 00:00:00 2001 From: Felipe Oliveira Carvalho Date: Thu, 23 Apr 2015 00:03:36 -0300 Subject: Improve comments and fix ascii_* attributes --- src/nvim/indent.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/nvim/indent.c') diff --git a/src/nvim/indent.c b/src/nvim/indent.c index c1733346fc..d3008185dc 100644 --- a/src/nvim/indent.c +++ b/src/nvim/indent.c @@ -706,7 +706,8 @@ int get_lisp_indent(void) if (vi_lisp || ((*that != '"') && (*that != '\'') && (*that != '#') && ((*that < '0') || (*that > '9')))) { - while (*that && (!ascii_iswhite(*that) || quotecount || parencount) + while (*that + && (!ascii_iswhite(*that) || quotecount || parencount) && (!((*that == '(' || *that == '[') && !quotecount && !parencount && vi_lisp))) { if (*that == '"') { -- cgit