vis icon indicating copy to clipboard operation
vis copied to clipboard

Writable Window.viewport

Open bzbug opened this issue 5 years ago • 2 comments

Ability to restore viewport like with cursor position.

bzbug avatar Dec 11 '20 04:12 bzbug

How is what you are asking for different from what the vis-cursor plugin as listed on the wiki already offers?

moesasji avatar Dec 11 '20 07:12 moesasji

@moesasji,

  1. Cursor position != viewport position. Cursor position can be changed, for example, with H, M and L keys. Viewport position can be changed with zt, zz and zb keys.
  2. I'm not asking to restore viewport position on startup per file. I'm asking to make Window.viewport writeable so that people could write plugins where viewport is changed for some purpose (on an already opened file) and then restored. For example, for plugins like retab which re-write the whole file line by line with different identation, it's important to restore not only cursor position but viewport as well on undo (undoing the whole file being written in one action), otherwise the whole thing will 'jump' unexpectedly if the viewport is automatically determined when restoring cursor position. Imagine changing your viewport slightly every time you undo things. You'll go crazy.

bzbug avatar Dec 11 '20 13:12 bzbug