Make linewrapping plugin recompute breaks before scrolling (#1190)

This commit is contained in:
Quinten Kock 2022-11-07 03:34:07 +01:00 committed by GitHub
parent 9c7304f555
commit 4a5851afe5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -365,8 +365,15 @@ function DocView:new(doc)
end
end
local old_scroll_to_line = DocView.scroll_to_line
function DocView:scroll_to_line(...)
LineWrapping.update_docview_breaks(self)
old_scroll_to_line(self, ...)
end
local old_scroll_to_make_visible = DocView.scroll_to_make_visible
function DocView:scroll_to_make_visible(line, col)
LineWrapping.update_docview_breaks(self)
old_scroll_to_make_visible(self, line, col)
if self.wrapped_settings then self.scroll.to.x = 0 end
end