Skip to content

Commit

Permalink
Create global option 'overwritewarning'
Browse files Browse the repository at this point in the history
  • Loading branch information
mcnelson committed May 25, 2022
1 parent 37ee800 commit 167e6d0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/nvim/fileio.c
Original file line number Diff line number Diff line change
Expand Up @@ -2618,7 +2618,7 @@ int buf_write(buf_T *buf, char *fname, char *sfname, linenr_T start, linenr_T en
/*
* Check if the timestamp hasn't changed since reading the file.
*/
if (overwriting) {
if (overwriting && p_ow) {
retval = check_mtime(buf, &file_info_old);
if (retval == FAIL) {
goto fail;
Expand Down
1 change: 1 addition & 0 deletions src/nvim/option_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@ EXTERN int p_mousef; // 'mousefocus'
EXTERN long p_mouset; // 'mousetime'
EXTERN int p_more; // 'more'
EXTERN char_u *p_opfunc; // 'operatorfunc'
EXTERN int p_ow; // 'overwritewarning'
EXTERN char_u *p_para; // 'paragraphs'
EXTERN int p_paste; // 'paste'
EXTERN char_u *p_pt; // 'pastetoggle'
Expand Down
7 changes: 7 additions & 0 deletions src/nvim/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1682,6 +1682,13 @@ return {
varname='p_opfunc',
defaults={if_true=""}
},
{
full_name='overwritewarning', abbreviation='ow',
short_desc=N_("enable warning when writing and the file has changed"),
type='bool', scope={'global'},
varname='p_ow',
defaults={if_true=true}
},
{
full_name='packpath', abbreviation='pp',
short_desc=N_("list of directories used for packages"),
Expand Down

0 comments on commit 167e6d0

Please sign in to comment.