diff options
author | Pavel Platto <hinidu@gmail.com> | 2014-05-16 11:59:00 +0300 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-05-28 10:42:06 -0400 |
commit | baaa4287851ecf478b40054efd7b786501eb70ef (patch) | |
tree | 37a5b788a29278e8a4e27b6e9c5c9f787da41a60 /src/nvim/indent_c.c | |
parent | 2a154ef71de506e64fbbc2d8e613b5a696f8cb60 (diff) | |
download | rneovim-baaa4287851ecf478b40054efd7b786501eb70ef.tar.gz rneovim-baaa4287851ecf478b40054efd7b786501eb70ef.tar.bz2 rneovim-baaa4287851ecf478b40054efd7b786501eb70ef.zip |
Remove ml_ prefix from cursor.h functions
s/ml_get_curline/get_cursor_line_ptr
s/ml_get_cursor/get_cursor_pos_ptr
Diffstat (limited to 'src/nvim/indent_c.c')
-rw-r--r-- | src/nvim/indent_c.c | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/src/nvim/indent_c.c b/src/nvim/indent_c.c index 8db16efb80..631ef06d01 100644 --- a/src/nvim/indent_c.c +++ b/src/nvim/indent_c.c @@ -267,7 +267,7 @@ int cin_islabel(void) { /* XXX */ char_u *s; - s = cin_skipcomment(ml_get_curline()); + s = cin_skipcomment(get_cursor_line_ptr()); /* * Exclude "default" from labels, since it should be indented @@ -298,7 +298,7 @@ int cin_islabel(void) if ((trypos = ind_find_start_comment()) != NULL) /* XXX */ curwin->w_cursor = *trypos; - line = ml_get_curline(); + line = get_cursor_line_ptr(); if (cin_ispreproc(line)) /* ignore #defines, #if, etc. */ continue; if (*(line = cin_skipcomment(line)) == NUL) @@ -328,7 +328,7 @@ static int cin_isinit(void) char_u *s; static char *skip[] = {"static", "public", "protected", "private"}; - s = cin_skipcomment(ml_get_curline()); + s = cin_skipcomment(get_cursor_line_ptr()); if (cin_starts_with(s, "typedef")) s = cin_skipcomment(s + 7); @@ -522,16 +522,16 @@ static int skip_label(linenr_T lnum, char_u **pp) cursor_save = curwin->w_cursor; curwin->w_cursor.lnum = lnum; - l = ml_get_curline(); + l = get_cursor_line_ptr(); /* XXX */ if (cin_iscase(l, FALSE) || cin_isscopedecl(l) || cin_islabel()) { amount = get_indent_nolabel(lnum); - l = after_label(ml_get_curline()); + l = after_label(get_cursor_line_ptr()); if (l == NULL) /* just in case */ - l = ml_get_curline(); + l = get_cursor_line_ptr(); } else { amount = get_indent(); - l = ml_get_curline(); + l = get_cursor_line_ptr(); } *pp = l; @@ -553,7 +553,7 @@ static int cin_first_id_amount(void) pos_T fp; colnr_T col; - line = ml_get_curline(); + line = get_cursor_line_ptr(); p = skipwhite(line); len = (int)(skiptowhite(p) - p); if (len == 6 && STRNCMP(p, "static", 6) == 0) { @@ -869,7 +869,7 @@ cin_iswhileofdo ( /* XXX */ cursor_save = curwin->w_cursor; curwin->w_cursor.lnum = lnum; curwin->w_cursor.col = 0; - p = ml_get_curline(); + p = get_cursor_line_ptr(); while (*p && *p != 'w') { /* skip any '}', until the 'w' of the "while" */ ++p; ++curwin->w_cursor.col; @@ -942,7 +942,7 @@ static int cin_iswhileofdo_end(int terminated) if (terminated != ';') /* there must be a ';' at the end */ return FALSE; - p = line = ml_get_curline(); + p = line = get_cursor_line_ptr(); while (*p != NUL) { p = cin_skipcomment(p); if (*p == ')') { @@ -964,7 +964,7 @@ static int cin_iswhileofdo_end(int terminated) } /* Searching may have made "line" invalid, get it again. */ - line = ml_get_curline(); + line = get_cursor_line_ptr(); p = line + i; } } @@ -1000,7 +1000,7 @@ cin_is_cpp_baseclass ( char_u *s; int class_or_struct, lookfor_ctor_init, cpp_base_class; linenr_T lnum = curwin->w_cursor.lnum; - char_u *line = ml_get_curline(); + char_u *line = get_cursor_line_ptr(); *col = 0; @@ -1126,10 +1126,10 @@ static int get_baseclass_amount(int col) if (col == 0) { amount = get_indent(); - if (find_last_paren(ml_get_curline(), '(', ')') + if (find_last_paren(get_cursor_line_ptr(), '(', ')') && (trypos = find_match_paren(curbuf->b_ind_maxparen)) != NULL) amount = get_indent_lnum(trypos->lnum); /* XXX */ - if (!cin_ends_in(ml_get_curline(), (char_u *)",", NULL)) + if (!cin_ends_in(get_cursor_line_ptr(), (char_u *)",", NULL)) amount += curbuf->b_ind_cpp_baseclass; } else { curwin->w_cursor.col = col; @@ -1866,7 +1866,7 @@ int get_c_indent(void) /* Ignore a '(' in front of the line that has a match before * our matching '('. */ curwin->w_cursor.lnum = our_paren_pos.lnum; - line = ml_get_curline(); + line = get_cursor_line_ptr(); look_col = (int)(look - line); curwin->w_cursor.col = look_col + 1; if ((trypos = findmatchlimit(NULL, ')', 0, @@ -2042,7 +2042,7 @@ int get_c_indent(void) * } */ if (curbuf->b_ind_js || (curbuf->b_ind_keep_case_label - && cin_iscase(skipwhite(ml_get_curline()), + && cin_iscase(skipwhite(get_cursor_line_ptr()), FALSE))) amount = get_indent(); else @@ -2106,7 +2106,7 @@ int get_c_indent(void) if (start_brace == BRACE_AT_END) { /* '{' is at end of line */ amount += curbuf->b_ind_open_imag; - l = skipwhite(ml_get_curline()); + l = skipwhite(get_cursor_line_ptr()); if (cin_is_cpp_namespace(l)) amount += curbuf->b_ind_cpp_namespace; } else { @@ -2178,7 +2178,7 @@ int get_c_indent(void) break; } - l = ml_get_curline(); + l = get_cursor_line_ptr(); /* * If we're in a comment now, skip to the start of the @@ -2287,7 +2287,7 @@ int get_c_indent(void) < ourscope - FIND_NAMESPACE_LIM) break; - l = ml_get_curline(); + l = get_cursor_line_ptr(); /* If we're in a comment now, skip to the start of * the comment. */ @@ -2325,7 +2325,7 @@ int get_c_indent(void) continue; } - l = ml_get_curline(); + l = get_cursor_line_ptr(); /* * If this is a switch() label, may line up relative to that. @@ -2406,7 +2406,7 @@ int get_c_indent(void) */ if (n) { amount = n; - l = after_label(ml_get_curline()); + l = after_label(get_cursor_line_ptr()); if (l != NULL && cin_is_cinword(l)) { if (theline[0] == '{') amount += curbuf->b_ind_open_extra; @@ -2450,7 +2450,7 @@ int get_c_indent(void) * Ignore jump labels with nothing after them. */ if (!curbuf->b_ind_js && cin_islabel()) { - l = after_label(ml_get_curline()); + l = after_label(get_cursor_line_ptr()); if (l == NULL || cin_nocode(l)) continue; } @@ -2461,7 +2461,7 @@ int get_c_indent(void) * (need to get the line again, cin_islabel() may have * unlocked it) */ - l = ml_get_curline(); + l = get_cursor_line_ptr(); if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum) || cin_nocode(l)) continue; @@ -2473,7 +2473,7 @@ int get_c_indent(void) n = FALSE; if (lookfor != LOOKFOR_TERM && curbuf->b_ind_cpp_baseclass > 0) { n = cin_is_cpp_baseclass(&col); - l = ml_get_curline(); + l = get_cursor_line_ptr(); } if (n) { if (lookfor == LOOKFOR_UNTERM) { @@ -2545,7 +2545,7 @@ int get_c_indent(void) * asdf) */ curwin->w_cursor = *trypos; - l = ml_get_curline(); + l = get_cursor_line_ptr(); if (cin_iscase(l, FALSE) || cin_isscopedecl(l)) { ++curwin->w_cursor.lnum; curwin->w_cursor.col = 0; @@ -2657,7 +2657,7 @@ int get_c_indent(void) * x = 1; * -> here */ - l = skipwhite(ml_get_curline()); + l = skipwhite(get_cursor_line_ptr()); if (cin_isdo(l)) { if (whilelevel == 0) break; @@ -2676,7 +2676,7 @@ int get_c_indent(void) * not the one from "if () {". */ if (*l == '}') curwin->w_cursor.col = - (colnr_T)(l - ml_get_curline()) + 1; + (colnr_T)(l - get_cursor_line_ptr()) + 1; if ((trypos = find_start_brace()) == NULL || find_match(LOOKFOR_IF, trypos->lnum) @@ -2802,7 +2802,7 @@ int get_c_indent(void) * may be lined up with the case label. */ if (lookfor == LOOKFOR_NOBREAK - && cin_isbreak(skipwhite(ml_get_curline()))) { + && cin_isbreak(skipwhite(get_cursor_line_ptr()))) { lookfor = LOOKFOR_ANY; continue; } @@ -2811,7 +2811,7 @@ int get_c_indent(void) * Handle "do {" line. */ if (whilelevel > 0) { - l = cin_skipcomment(ml_get_curline()); + l = cin_skipcomment(get_cursor_line_ptr()); if (cin_isdo(l)) { amount = get_indent(); /* XXX */ --whilelevel; @@ -2867,7 +2867,7 @@ int get_c_indent(void) * here; */ term_again: - l = ml_get_curline(); + l = get_cursor_line_ptr(); if (find_last_paren(l, '(', ')') && (trypos = find_match_paren( curbuf->b_ind_maxparen)) != NULL) { @@ -2878,7 +2878,7 @@ term_again: * asdf) */ curwin->w_cursor = *trypos; - l = ml_get_curline(); + l = get_cursor_line_ptr(); if (cin_iscase(l, FALSE) || cin_isscopedecl(l)) { ++curwin->w_cursor.lnum; curwin->w_cursor.col = 0; @@ -2935,13 +2935,13 @@ term_again: * If we're at the end of a block, skip to the start of * that block. */ - l = ml_get_curline(); + l = get_cursor_line_ptr(); if (find_last_paren(l, '{', '}') /* XXX */ && (trypos = find_start_brace()) != NULL) { curwin->w_cursor = *trypos; /* if not "else {" check for terminated again */ /* but skip block for "} else {" */ - l = cin_skipcomment(ml_get_curline()); + l = cin_skipcomment(get_cursor_line_ptr()); if (*l == '}' || !cin_iselse(l)) goto term_again; ++curwin->w_cursor.lnum; @@ -3006,7 +3006,7 @@ term_again: curwin->w_cursor.lnum--; curwin->w_cursor.col = 0; - l = ml_get_curline(); + l = get_cursor_line_ptr(); /* * If we're in a comment now, skip to the start of the comment. @@ -3024,7 +3024,7 @@ term_again: n = FALSE; if (curbuf->b_ind_cpp_baseclass != 0 && theline[0] != '{') { n = cin_is_cpp_baseclass(&col); - l = ml_get_curline(); + l = get_cursor_line_ptr(); } if (n) { /* XXX */ @@ -3091,7 +3091,7 @@ term_again: */ if (cin_isfuncdecl(NULL, cur_curpos.lnum, 0)) /* XXX */ break; - l = ml_get_curline(); + l = get_cursor_line_ptr(); /* * Finding the closing '}' of a previous function. Put @@ -3152,7 +3152,7 @@ term_again: if (cin_ends_in(l, (char_u *)",", NULL) || (*l != NUL && l[STRLEN(l) - 1] == '\\')) break; - l = ml_get_curline(); + l = get_cursor_line_ptr(); } /* @@ -3226,7 +3226,7 @@ static int find_match(int lookfor, linenr_T ourscope) curwin->w_cursor.lnum--; curwin->w_cursor.col = 0; - look = cin_skipcomment(ml_get_curline()); + look = cin_skipcomment(get_cursor_line_ptr()); if (cin_iselse(look) || cin_isif(look) || cin_isdo(look) /* XXX */ @@ -3260,7 +3260,7 @@ static int find_match(int lookfor, linenr_T ourscope) * then we need to go back to another if, so * increment elselevel */ - look = cin_skipcomment(ml_get_curline()); + look = cin_skipcomment(get_cursor_line_ptr()); if (cin_iselse(look)) { mightbeif = cin_skipcomment(look + 4); if (!cin_isif(mightbeif)) @@ -3278,7 +3278,7 @@ static int find_match(int lookfor, linenr_T ourscope) } /* If it's an "if" decrement elselevel */ - look = cin_skipcomment(ml_get_curline()); + look = cin_skipcomment(get_cursor_line_ptr()); if (cin_isif(look)) { elselevel--; /* |