comparison runtime/doc/eval.txt @ 5940:f6f754304324 v7.4.311

updated for version 7.4.311 Problem: Can't use winrestview to only restore part of the view. Solution: Handle missing items in the dict. (Christian Brabandt)
author Bram Moolenaar <bram@vim.org>
date Wed, 28 May 2014 16:47:16 +0200
parents ccac0aa34eea
children 66eead134d68
comparison
equal deleted inserted replaced
5939:f972a1841779 5940:f6f754304324
6408 < 6408 <
6409 *winrestview()* 6409 *winrestview()*
6410 winrestview({dict}) 6410 winrestview({dict})
6411 Uses the |Dictionary| returned by |winsaveview()| to restore 6411 Uses the |Dictionary| returned by |winsaveview()| to restore
6412 the view of the current window. 6412 the view of the current window.
6413 Note: The {dict} does not have to contain all values, that are
6414 returned by |winsaveview()|. If values are missing, those
6415 settings won't be restored. So you can use: >
6416 :call winrestview({'curswant': 4})
6417 <
6418 This will only set the curswant value (the column the cursor
6419 wants to move on vertical movements) of the cursor to column 5
6420 (yes, that is 5), while all other settings will remain the
6421 same. This is useful, if you set the cursor position manually.
6422
6413 If you have changed the values the result is unpredictable. 6423 If you have changed the values the result is unpredictable.
6414 If the window size changed the result won't be the same. 6424 If the window size changed the result won't be the same.
6415 6425
6416 *winsaveview()* 6426 *winsaveview()*
6417 winsaveview() Returns a |Dictionary| that contains information to restore 6427 winsaveview() Returns a |Dictionary| that contains information to restore
6422 This does not save fold information. Use the 'foldenable' 6432 This does not save fold information. Use the 'foldenable'
6423 option to temporarily switch off folding, so that folds are 6433 option to temporarily switch off folding, so that folds are
6424 not opened when moving around. 6434 not opened when moving around.
6425 The return value includes: 6435 The return value includes:
6426 lnum cursor line number 6436 lnum cursor line number
6427 col cursor column 6437 col cursor column (Note: the first column
6438 zero, as opposed to what getpos()
6439 returns)
6428 coladd cursor column offset for 'virtualedit' 6440 coladd cursor column offset for 'virtualedit'
6429 curswant column for vertical movement 6441 curswant column for vertical movement
6430 topline first line in the window 6442 topline first line in the window
6431 topfill filler lines, only in diff mode 6443 topfill filler lines, only in diff mode
6432 leftcol first column displayed 6444 leftcol first column displayed