From 1cbc8301897c09d381074397b82450f81d7854be Mon Sep 17 00:00:00 2001 From: David Hotham Date: Mon, 25 Jun 2018 01:14:55 +0100 Subject: API: nvim_win_set_cursor: set curswant #8613 Fixes #8591 --- src/nvim/api/window.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/nvim/api/window.c') diff --git a/src/nvim/api/window.c b/src/nvim/api/window.c index abfa0dc20b..b02e5b958d 100644 --- a/src/nvim/api/window.c +++ b/src/nvim/api/window.c @@ -93,6 +93,9 @@ void nvim_win_set_cursor(Window window, ArrayOf(Integer, 2) pos, Error *err) // When column is out of range silently correct it. check_cursor_col_win(win); + // Make sure we stick in this column. + win->w_curswant = (colnr_T)col; + // make sure cursor is in visible range even if win != curwin update_topline_win(win); -- cgit