Split window same buffer; view position
tom-adsfund opened this issue · 2 comments
A relatively common thing I do is split a window to look at one part of a buffer, while editing another.
In Liquid I think the window view position is stored in the buffer, and so when I edit in either window both windows share the same view.
Would be good to have a view point for each window.
The "top-of-window" is stored in a map with keys consiting of a combination of windowname and buffername, so actually each window has its own view, even if they show the same buffer.
But, if the cursor is moved outside the window, a recenter will be executed on each window with the cursor outside. (This will be noticeable if the two windows are of different size, because recentering "out of sync").
One solution to the problem could be to avoid calling recenter on inactive windows, the view on the inactive window will then not be updated until it is activated, in which case it will scroll to the cursor as well. If we want to "fake" window-specific cursors, we can save the cursor position, as a mark in the slider, when a window is deactived and then move cursor back to the mark when activated. (Saving position will not be good, as edits in the other active window might "move" the content. Using marks will make the saved cursor position move together with the text.)
Related to old implementation of Liquid.