From 41009a3bbf367bab2bb6140ed0d71860be4e998b Mon Sep 17 00:00:00 2001 From: Petter Rodhelind Date: Thu, 4 Mar 2021 09:02:14 +0100 Subject: Add Get command to reload buffer from disk. --- ui/tcell/tcell.go | 14 ++++++++++++++ ui/tcell/window.go | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'ui/tcell') diff --git a/ui/tcell/tcell.go b/ui/tcell/tcell.go index 20b59d5..ad27bd5 100644 --- a/ui/tcell/tcell.go +++ b/ui/tcell/tcell.go @@ -138,6 +138,7 @@ func initCommands() { "New": CmdNew, "Newcol": CmdNewcol, "Del": CmdDel, + "Get": CmdGet, "Exit": CmdExit, } } @@ -266,6 +267,19 @@ func CmdNewcol() { CmdNew() } +func CmdGet() { + screen.Clear() + wins := AllWindows() + for _, win := range wins { + if win.tagline.focused { + q0, q1 := win.body.text.Dot() + win.body.text.Destroy() + win.body.text.ReadFile() + win.body.text.SetDot(q0, q1) + } + } +} + func CmdExit() { exit := true wins := AllWindows() diff --git a/ui/tcell/window.go b/ui/tcell/window.go index ba4220c..86f9ce4 100644 --- a/ui/tcell/window.go +++ b/ui/tcell/window.go @@ -41,7 +41,7 @@ func NewWindow(id int64) *Window { }, } - fmt.Fprintf(win.tagline, "%s Del ", + fmt.Fprintf(win.tagline, "%s Del Get ", win.TagName(), ) -- cgit v1.2.3