diff options
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r-- | src/nvim/ex_cmds.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 5b6604fc93..b72d1941ec 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -1533,7 +1533,7 @@ void write_viminfo(char_u *file, int forceit) */ FileInfo old_info; // FileInfo of existing viminfo file - if (os_get_file_info((char *)fname, &old_info) + if (os_fileinfo((char *)fname, &old_info) && getuid() != ROOT_UID && !(old_info.stat.st_uid == getuid() ? (old_info.stat.st_mode & 0200) @@ -4610,19 +4610,19 @@ prepare_tagpreview ( bool undo_sync /* sync undo when leaving the window */ ) { - win_T *wp; - - /* * If there is already a preview window open, use that one. */ if (!curwin->w_p_pvw) { - for (wp = firstwin; wp != NULL; wp = wp->w_next) - if (wp->w_p_pvw) + bool found_win = false; + FOR_ALL_WINDOWS(wp) { + if (wp->w_p_pvw) { + win_enter(wp, undo_sync); + found_win = true; break; - if (wp != NULL) - win_enter(wp, undo_sync); - else { + } + } + if (!found_win) { /* * There is no preview window open yet. Create one. */ |