mirror of
https://github.com/neovim/neovim.git
synced 2025-10-06 01:46:29 +00:00
refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
This commit is contained in:
@@ -117,7 +117,7 @@ void internal_format(int textwidth, int second_indent, int flags, bool format_on
|
||||
|
||||
// Don't break until after the comment leader
|
||||
if (do_comments) {
|
||||
char_u *line = get_cursor_line_ptr();
|
||||
char_u *line = (char_u *)get_cursor_line_ptr();
|
||||
leader_len = get_leader_len((char *)line, NULL, false, true);
|
||||
if (leader_len == 0 && curbuf->b_p_cin) {
|
||||
// Check for a line comment after code.
|
||||
@@ -624,8 +624,8 @@ void auto_format(bool trailblank, bool prev_line)
|
||||
{
|
||||
pos_T pos;
|
||||
colnr_T len;
|
||||
char_u *old;
|
||||
char_u *new, *pnew;
|
||||
char *old;
|
||||
char *new, *pnew;
|
||||
int wasatend;
|
||||
int cc;
|
||||
|
||||
@@ -663,7 +663,7 @@ void auto_format(bool trailblank, bool prev_line)
|
||||
// With the 'c' flag in 'formatoptions' and 't' missing: only format
|
||||
// comments.
|
||||
if (has_format_option(FO_WRAP_COMS) && !has_format_option(FO_WRAP)
|
||||
&& get_leader_len((char *)old, NULL, false, true) == 0) {
|
||||
&& get_leader_len(old, NULL, false, true) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -700,10 +700,10 @@ void auto_format(bool trailblank, bool prev_line)
|
||||
new = get_cursor_line_ptr();
|
||||
len = (colnr_T)STRLEN(new);
|
||||
if (curwin->w_cursor.col == len) {
|
||||
pnew = vim_strnsave(new, (size_t)len + 2);
|
||||
pnew = xstrnsave(new, (size_t)len + 2);
|
||||
pnew[len] = ' ';
|
||||
pnew[len + 1] = NUL;
|
||||
ml_replace(curwin->w_cursor.lnum, (char *)pnew, false);
|
||||
ml_replace(curwin->w_cursor.lnum, pnew, false);
|
||||
// remove the space later
|
||||
did_add_space = true;
|
||||
} else {
|
||||
@@ -1026,7 +1026,7 @@ void format_lines(linenr_T line_count, bool avoid_fex)
|
||||
// paragraph doesn't really end.
|
||||
if (next_leader_flags == NULL
|
||||
|| STRNCMP(next_leader_flags, "://", 3) != 0
|
||||
|| check_linecomment((char *)get_cursor_line_ptr()) == MAXCOL) {
|
||||
|| check_linecomment(get_cursor_line_ptr()) == MAXCOL) {
|
||||
is_end_par = true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user