aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/window.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-04-01 21:59:21 +0200
committerGitHub <noreply@github.com>2019-04-01 21:59:21 +0200
commita011f8a3211cfc3369437d8686c6999d491ba290 (patch)
tree532d2f86b5d8d79dc16c8bc69181a683f6c55a35 /src/nvim/window.c
parentd13803f64fc5607c6319087240e35a8b86082f64 (diff)
parentacdcae6b1e14233e75b98b8e88840afeb96d5fb7 (diff)
downloadrneovim-a011f8a3211cfc3369437d8686c6999d491ba290.tar.gz
rneovim-a011f8a3211cfc3369437d8686c6999d491ba290.tar.bz2
rneovim-a011f8a3211cfc3369437d8686c6999d491ba290.zip
Merge #9827 from justinmk/fix-warnings
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r--src/nvim/window.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c
index ad38a34dac..e135d7436d 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -2575,15 +2575,12 @@ void win_close_othertab(win_T *win, int free_buf, tabpage_T *tp)
free_tabpage(tp);
}
-/*
- * Free the memory used for a window.
- * Returns a pointer to the window that got the freed up space.
- */
-static win_T *
-win_free_mem (
+// Free the memory used for a window.
+// Returns a pointer to the window that got the freed up space.
+static win_T *win_free_mem(
win_T *win,
- int *dirp, /* set to 'v' or 'h' for direction if 'ea' */
- tabpage_T *tp /* tab page "win" is in, NULL for current */
+ int *dirp, // set to 'v' or 'h' for direction if 'ea'
+ tabpage_T *tp // tab page "win" is in, NULL for current
)
{
frame_T *frp;
@@ -2595,6 +2592,7 @@ win_free_mem (
wp = winframe_remove(win, dirp, tp);
xfree(frp);
} else {
+ *dirp = 'h'; // Dummy value.
if (win_valid(prevwin) && prevwin != win) {
wp = prevwin;
} else {
@@ -2603,10 +2601,11 @@ win_free_mem (
}
win_free(win, tp);
- /* When deleting the current window of another tab page select a new
- * current window. */
- if (tp != NULL && win == tp->tp_curwin)
+ // When deleting the current window of another tab page select a new
+ // current window.
+ if (tp != NULL && win == tp->tp_curwin) {
tp->tp_curwin = wp;
+ }
return wp;
}