aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r--src/nvim/window.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 1bff5933ea..4076bb2531 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -515,9 +515,14 @@ wingotofile:
if ((len = find_ident_under_cursor(&ptr, FIND_IDENT)) == 0) {
break;
}
+
+ // Make a copy, if the line was changed it will be freed.
+ ptr = vim_strnsave(ptr, len);
+
find_pattern_in_path(ptr, 0, len, true, Prenum == 0,
type, Prenum1, ACTION_SPLIT, 1, MAXLNUM);
- curwin->w_set_curswant = TRUE;
+ xfree(ptr);
+ curwin->w_set_curswant = true;
break;
// Quickfix window only: view the result under the cursor in a new split.
@@ -6292,7 +6297,6 @@ void win_set_inner_size(win_T *wp)
}
wp->w_skipcol = 0;
wp->w_height_inner = height;
- wp->w_winrow_off = wp->w_border_adj[0] + wp->w_winbar_height;
// There is no point in adjusting the scroll position when exiting. Some
// values might be invalid.
@@ -6320,11 +6324,13 @@ void win_set_inner_size(win_T *wp)
wp->w_height_outer = (wp->w_height_inner + win_extra_height(wp));
wp->w_width_outer = (wp->w_width_inner + win_extra_width(wp));
+ wp->w_winrow_off = wp->w_border_adj[0] + wp->w_winbar_height;
+ wp->w_wincol_off = wp->w_border_adj[3];
}
static int win_extra_height(win_T *wp)
{
- return wp->w_border_adj[0] + wp->w_border_adj[2];
+ return wp->w_border_adj[0] + wp->w_border_adj[2] + wp->w_winbar_height;
}
static int win_extra_width(win_T *wp)