aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorPetter Rodhelind <petter.rodhelind@gmail.com>2021-03-04 09:02:14 +0100
committerPetter Rodhelind <petter.rodhelind@gmail.com>2021-03-04 09:02:14 +0100
commit41009a3bbf367bab2bb6140ed0d71860be4e998b (patch)
tree55f2b968f1c600fd833f40bce18c0ddb13f9b408 /ui
parent93f7f1c5c0cbb074109b2681bd78b09b6efb3bb4 (diff)
downloadpoe-41009a3bbf367bab2bb6140ed0d71860be4e998b.tar.gz
poe-41009a3bbf367bab2bb6140ed0d71860be4e998b.tar.bz2
poe-41009a3bbf367bab2bb6140ed0d71860be4e998b.zip
Add Get command to reload buffer from disk.
Diffstat (limited to 'ui')
-rw-r--r--ui/tcell/tcell.go14
-rw-r--r--ui/tcell/window.go2
2 files changed, 15 insertions, 1 deletions
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(),
)