diff options
author | Bram Moolenaar <Bram@vim.org> | 2014-05-28 16:47:16 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2014-05-28 16:47:16 +0200 |
commit | 82c2585eb840a84240ef927c09df28d5a04302b1 (patch) | |
tree | dbe8f042b02eac6d5f8c2a61f2b741ce6b55098e /runtime/doc/eval.txt | |
parent | 493c178a2851587ca3f9deae3b41ae3acf5c900b (diff) | |
download | vim-git-82c2585eb840a84240ef927c09df28d5a04302b1.tar.gz |
updated for version 7.4.311v7.4.311
Problem: Can't use winrestview to only restore part of the view.
Solution: Handle missing items in the dict. (Christian Brabandt)
Diffstat (limited to 'runtime/doc/eval.txt')
-rw-r--r-- | runtime/doc/eval.txt | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 94cdf2b9d..09a081703 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -6410,6 +6410,16 @@ winrestcmd() Returns a sequence of |:resize| commands that should restore winrestview({dict}) Uses the |Dictionary| returned by |winsaveview()| to restore the view of the current window. + Note: The {dict} does not have to contain all values, that are + returned by |winsaveview()|. If values are missing, those + settings won't be restored. So you can use: > + :call winrestview({'curswant': 4}) +< + This will only set the curswant value (the column the cursor + wants to move on vertical movements) of the cursor to column 5 + (yes, that is 5), while all other settings will remain the + same. This is useful, if you set the cursor position manually. + If you have changed the values the result is unpredictable. If the window size changed the result won't be the same. @@ -6424,7 +6434,9 @@ winsaveview() Returns a |Dictionary| that contains information to restore not opened when moving around. The return value includes: lnum cursor line number - col cursor column + col cursor column (Note: the first column + zero, as opposed to what getpos() + returns) coladd cursor column offset for 'virtualedit' curswant column for vertical movement topline first line in the window |