aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fileio.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r--src/nvim/fileio.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 494b557379..290de034d7 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -4311,15 +4311,13 @@ static int make_bom(char_u *buf, char_u *name)
return (int)(p - buf);
}
-/*
- * Shorten filename of a buffer.
- * When "force" is TRUE: Use full path from now on for files currently being
- * edited, both for file name and swap file name. Try to shorten the file
- * names a bit, if safe to do so.
- * When "force" is FALSE: Only try to shorten absolute file names.
- * For buffers that have buftype "nofile" or "scratch": never change the file
- * name.
- */
+/// Shorten filename of a buffer.
+/// When "force" is TRUE: Use full path from now on for files currently being
+/// edited, both for file name and swap file name. Try to shorten the file
+/// names a bit, if safe to do so.
+/// When "force" is FALSE: Only try to shorten absolute file names.
+/// For buffers that have buftype "nofile" or "scratch": never change the file
+/// name.
void shorten_buf_fname(buf_T *buf, char_u *dirname, int force)
{
char_u *p;
@@ -4337,8 +4335,9 @@ void shorten_buf_fname(buf_T *buf, char_u *dirname, int force)
buf->b_sfname = vim_strsave(p);
buf->b_fname = buf->b_sfname;
}
- if (p == NULL || buf->b_fname == NULL)
+ if (p == NULL || buf->b_fname == NULL) {
buf->b_fname = buf->b_ffname;
+ }
}
}