summaryrefslogtreecommitdiffstats
path: root/vendor/github.com
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2024-06-28 08:14:05 +0200
committerStefan Haller <stefan@haller-berlin.de>2024-06-28 08:14:05 +0200
commit32cfe7a5c3d325e035f0768d0ff2a37cdec2aff6 (patch)
treec2c5cd1875426d0dc7f8af42279ab02fa307c665 /vendor/github.com
parentb795d91fa8112534db96311eb86d339066dedb07 (diff)
Bump gocui
Diffstat (limited to 'vendor/github.com')
-rw-r--r--vendor/github.com/jesseduffield/gocui/gui.go18
1 files changed, 15 insertions, 3 deletions
diff --git a/vendor/github.com/jesseduffield/gocui/gui.go b/vendor/github.com/jesseduffield/gocui/gui.go
index e2593b985..0c64e6925 100644
--- a/vendor/github.com/jesseduffield/gocui/gui.go
+++ b/vendor/github.com/jesseduffield/gocui/gui.go
@@ -307,14 +307,26 @@ func (g *Gui) SetView(name string, x0, y0, x1, y1 int, overlaps byte) (*View, er
}
if v, err := g.View(name); err == nil {
- if v.x0 != x0 || v.x1 != x1 || v.y0 != y0 || v.y1 != y1 {
- v.clearViewLines()
- }
+ sizeChanged := v.x0 != x0 || v.x1 != x1 || v.y0 != y0 || v.y1 != y1
v.x0 = x0
v.y0 = y0
v.x1 = x1
v.y1 = y1
+
+ if sizeChanged {
+ v.clearViewLines()
+
+ if v.Editable {
+ cursorX, cursorY := v.TextArea.GetCursorXY()
+ newViewCursorX, newOriginX := updatedCursorAndOrigin(0, v.InnerWidth(), cursorX)
+ newViewCursorY, newOriginY := updatedCursorAndOrigin(0, v.InnerHeight(), cursorY)
+
+ _ = v.SetCursor(newViewCursorX, newViewCursorY)
+ _ = v.SetOrigin(newOriginX, newOriginY)
+ }
+ }
+
return v, nil
}