diff options
Diffstat (limited to 'src/textformat.c')
-rw-r--r-- | src/textformat.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/textformat.c b/src/textformat.c index 500e8895c8..14acc53cd0 100644 --- a/src/textformat.c +++ b/src/textformat.c @@ -455,7 +455,7 @@ internal_format( // Check if cursor is not past the NUL off the line, cindent // may have added or removed indent. curwin->w_cursor.col += startcol; - len = (colnr_T)STRLEN(ml_get_curline()); + len = ml_get_curline_len(); if (curwin->w_cursor.col > len) curwin->w_cursor.col = len; } @@ -531,9 +531,7 @@ ends_in_white(linenr_T lnum) if (*s == NUL) return FALSE; - // Don't use STRLEN() inside VIM_ISWHITE(), SAS/C complains: "macro - // invocation may call function multiple times". - l = STRLEN(s) - 1; + l = ml_get_len(lnum) - 1; return VIM_ISWHITE(s[l]); } @@ -573,7 +571,7 @@ same_leader( return FALSE; if (*p == COM_START) { - int line_len = (int)STRLEN(ml_get(lnum)); + int line_len = ml_get_len(lnum); if (line_len <= leader1_len) return FALSE; if (leader2_flags == NULL || leader2_len == 0) @@ -684,7 +682,7 @@ auto_format( // in 'formatoptions' and there is a single character before the cursor. // Otherwise the line would be broken and when typing another non-white // next they are not joined back together. - wasatend = (pos.col == (colnr_T)STRLEN(old)); + wasatend = (pos.col == ml_get_curline_len()); if (*old != NUL && !trailblank && wasatend) { dec_cursor(); @@ -740,7 +738,7 @@ auto_format( if (!wasatend && has_format_option(FO_WHITE_PAR)) { new = ml_get_curline(); - len = (colnr_T)STRLEN(new); + len = ml_get_curline_len(); if (curwin->w_cursor.col == len) { pnew = vim_strnsave(new, len + 2); @@ -1217,7 +1215,7 @@ format_lines( } first_par_line = FALSE; // If the line is getting long, format it next time - if (STRLEN(ml_get_curline()) > (size_t)max_len) + if (ml_get_curline_len() > max_len) force_format = TRUE; else force_format = FALSE; |