aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/diff.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-08-25 22:35:20 +0200
committerGitHub <noreply@github.com>2022-08-25 22:35:20 +0200
commit6e9980fc3b6f8e246632aef0f4b8c0edf30e24f0 (patch)
tree163d6c0553e6c9f7a91d7d0d97e369722dca75be /src/nvim/diff.c
parentbfd1adc62c615e7b65bdfe6d3c21158708eb4314 (diff)
parent40855b0143a864739a6037921e15699445dcf8a7 (diff)
downloadrneovim-6e9980fc3b6f8e246632aef0f4b8c0edf30e24f0.tar.gz
rneovim-6e9980fc3b6f8e246632aef0f4b8c0edf30e24f0.tar.bz2
rneovim-6e9980fc3b6f8e246632aef0f4b8c0edf30e24f0.zip
Merge pull request #19628 from dundargoc/refactor/char_u/2
refactor: replace char_u with char
Diffstat (limited to 'src/nvim/diff.c')
-rw-r--r--src/nvim/diff.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/nvim/diff.c b/src/nvim/diff.c
index 90d621ae1e..fa1c669aaf 100644
--- a/src/nvim/diff.c
+++ b/src/nvim/diff.c
@@ -797,8 +797,8 @@ static int diff_write(buf_T *buf, diffin_T *din)
}
// Always use 'fileformat' set to "unix".
- char_u *save_ff = buf->b_p_ff;
- buf->b_p_ff = vim_strsave((char_u *)FF_UNIX);
+ char *save_ff = buf->b_p_ff;
+ buf->b_p_ff = xstrdup(FF_UNIX);
const bool save_cmod_flags = cmdmod.cmod_flags;
// Writing the buffer is an implementation detail of performing the diff,
// so it shouldn't update the '[ and '] marks.
@@ -1413,7 +1413,7 @@ void diff_win_options(win_T *wp, int addbuf)
if (wp->w_p_diff_saved) {
free_string_option(wp->w_p_fdm_save);
}
- wp->w_p_fdm_save = vim_strsave(wp->w_p_fdm);
+ wp->w_p_fdm_save = xstrdup(wp->w_p_fdm);
}
set_string_option_direct_in_win(wp, "fdm", -1, "diff", OPT_LOCAL | OPT_FREE, 0);
@@ -1424,12 +1424,12 @@ void diff_win_options(win_T *wp, int addbuf)
if (wp->w_p_diff_saved) {
free_string_option(wp->w_p_fdc_save);
}
- wp->w_p_fdc_save = vim_strsave(wp->w_p_fdc);
+ wp->w_p_fdc_save = xstrdup(wp->w_p_fdc);
}
free_string_option(wp->w_p_fdc);
- wp->w_p_fdc = (char_u *)xstrdup("2");
+ wp->w_p_fdc = xstrdup("2");
assert(diff_foldcolumn >= 0 && diff_foldcolumn <= 9);
- snprintf((char *)wp->w_p_fdc, STRLEN(wp->w_p_fdc) + 1, "%d", diff_foldcolumn);
+ snprintf(wp->w_p_fdc, STRLEN(wp->w_p_fdc) + 1, "%d", diff_foldcolumn);
wp->w_p_fen = true;
wp->w_p_fdl = 0;
foldUpdateAll(wp);
@@ -1480,11 +1480,9 @@ void ex_diffoff(exarg_T *eap)
}
}
free_string_option(wp->w_p_fdm);
- wp->w_p_fdm = vim_strsave(*wp->w_p_fdm_save
- ? wp->w_p_fdm_save
- : (char_u *)"manual");
+ wp->w_p_fdm = xstrdup(*wp->w_p_fdm_save ? wp->w_p_fdm_save : "manual");
free_string_option(wp->w_p_fdc);
- wp->w_p_fdc = vim_strsave(wp->w_p_fdc_save);
+ wp->w_p_fdc = xstrdup(wp->w_p_fdc_save);
if (wp->w_p_fdl == 0) {
wp->w_p_fdl = wp->w_p_fdl_save;