Skip to main content
Deno 2 is finally here ๐ŸŽ‰๏ธ
Learn more
Module

x/denops_std/function/mod.ts>winrestview

๐Ÿ“š Standard module for denops.vim
Go to Latest
function winrestview
import { winrestview } from "https://deno.land/x/denops_std@v4.1.5/function/mod.ts";

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.

Can also be used as a method:

GetView()->winrestview()

Parameters

denops: Denops
dict: unknown

Returns

Promise<unknown>