aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/textformat.c
diff options
context:
space:
mode:
authorii14 <59243201+ii14@users.noreply.github.com>2023-04-06 22:39:50 +0200
committerGitHub <noreply@github.com>2023-04-06 22:39:50 +0200
commit7190dba017e3aac0409c73ff1c954d18858cb3c9 (patch)
tree321f4b2dd65e4a06047beee876d3c2e0d2dbf7d0 /src/nvim/textformat.c
parent0bc323850410df4c3c1dd8fabded9d2000189270 (diff)
downloadrneovim-7190dba017e3aac0409c73ff1c954d18858cb3c9.tar.gz
rneovim-7190dba017e3aac0409c73ff1c954d18858cb3c9.tar.bz2
rneovim-7190dba017e3aac0409c73ff1c954d18858cb3c9.zip
refactor: remove use of reserved c++ keywords
libnvim couldn't be easily used in C++ due to the use of reserved keywords. Additionally, add explicit casts to *alloc function calls used in inline functions, as C++ doesn't allow implicit casts from void pointers.
Diffstat (limited to 'src/nvim/textformat.c')
-rw-r--r--src/nvim/textformat.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/nvim/textformat.c b/src/nvim/textformat.c
index 05e57e4b8f..c406f0c302 100644
--- a/src/nvim/textformat.c
+++ b/src/nvim/textformat.c
@@ -634,7 +634,7 @@ static bool paragraph_start(linenr_T lnum)
void auto_format(bool trailblank, bool prev_line)
{
colnr_T len;
- char *new, *pnew;
+ char *linep, *plinep;
int cc;
if (!has_format_option(FO_AUTO)) {
@@ -705,13 +705,13 @@ void auto_format(bool trailblank, bool prev_line)
// need to add a space when 'w' is in 'formatoptions' to keep a paragraph
// formatted.
if (!wasatend && has_format_option(FO_WHITE_PAR)) {
- new = get_cursor_line_ptr();
- len = (colnr_T)strlen(new);
+ linep = get_cursor_line_ptr();
+ len = (colnr_T)strlen(linep);
if (curwin->w_cursor.col == len) {
- pnew = xstrnsave(new, (size_t)len + 2);
- pnew[len] = ' ';
- pnew[len + 1] = NUL;
- ml_replace(curwin->w_cursor.lnum, pnew, false);
+ plinep = xstrnsave(linep, (size_t)len + 2);
+ plinep[len] = ' ';
+ plinep[len + 1] = NUL;
+ ml_replace(curwin->w_cursor.lnum, plinep, false);
// remove the space later
did_add_space = true;
} else {