diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2014-11-01 21:24:58 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-11-01 21:24:58 -0400 |
commit | 48847fbafc41d93bbc42d7bf5711a47c4982e08c (patch) | |
tree | 4f6c374b801ac8744b2a8c31451df4f88079c1e3 /src/nvim/move.c | |
parent | 92173edbc0d35420056034d5139a71575e370538 (diff) | |
parent | d6da42475888bae48104d1de98fcc9640b619de3 (diff) | |
download | rneovim-48847fbafc41d93bbc42d7bf5711a47c4982e08c.tar.gz rneovim-48847fbafc41d93bbc42d7bf5711a47c4982e08c.tar.bz2 rneovim-48847fbafc41d93bbc42d7bf5711a47c4982e08c.zip |
Merge pull request #951 from bfredl/curfix
api: window_set_cursor doesn't always update position.
Diffstat (limited to 'src/nvim/move.c')
-rw-r--r-- | src/nvim/move.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/nvim/move.c b/src/nvim/move.c index 2118f58f7e..c43fa1d09d 100644 --- a/src/nvim/move.c +++ b/src/nvim/move.c @@ -34,6 +34,7 @@ #include "nvim/popupmnu.h" #include "nvim/screen.h" #include "nvim/strings.h" +#include "nvim/window.h" typedef struct { linenr_T lnum; /* line number */ @@ -315,6 +316,17 @@ void update_topline(void) } /* + * Update win->w_topline to move the cursor onto the screen. + */ +void update_topline_win(win_T* win) +{ + win_T *save_curwin; + switch_win(&save_curwin, NULL, win, NULL, true); + update_topline(); + restore_win(save_curwin, NULL, true); +} + +/* * Return the scrolljump value to use for the current window. * When 'scrolljump' is positive use it as-is. * When 'scrolljump' is negative use it as a percentage of the window height. |