From d4caf4510c15e6485f6eb68ee6fed6126d48c005 Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Mon, 30 May 2016 18:22:10 -0400 Subject: [PATCH] Fix bug with on reopen --- cmd/micro/buffer.go | 2 +- cmd/micro/view.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/micro/buffer.go b/cmd/micro/buffer.go index c74ee3b7..fbcb602a 100644 --- a/cmd/micro/buffer.go +++ b/cmd/micro/buffer.go @@ -162,9 +162,9 @@ func (b *Buffer) ReOpen() { } b.ModTime, _ = GetModTime(b.Path) - b.Cursor.Relocate() b.IsModified = false b.Update() + b.Cursor.Relocate() } // Update fetches the string from the rope and updates the `text` and `lines` in the buffer diff --git a/cmd/micro/view.go b/cmd/micro/view.go index 343e9f6e..8d85692c 100644 --- a/cmd/micro/view.go +++ b/cmd/micro/view.go @@ -192,6 +192,8 @@ func (v *View) CloseBuffer() { func (v *View) ReOpen() { if v.CanClose("Continue? (yes, no, save) ") { v.Buf.ReOpen() + v.Relocate() + v.matches = Match(v) } }