summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2019-05-26 12:27:59 +1000
committerJesse Duffield <jessedduffield@gmail.com>2019-05-26 12:42:17 +1000
commitc039e5bed06192ad536e07da7cf89a2502070a1d (patch)
tree4cbf1d96497557f9e7cccf6b5d0674679fef0159 /pkg
parent527c025a0c6a445230b88dfa2d4197554e5fc130 (diff)
support going to start/end of line and deleting lines in simple editor
Diffstat (limited to 'pkg')
-rw-r--r--pkg/gui/commit_message_panel.go27
-rw-r--r--pkg/gui/gui.go2
2 files changed, 0 insertions, 29 deletions
diff --git a/pkg/gui/commit_message_panel.go b/pkg/gui/commit_message_panel.go
index 62892f09b..b087f5904 100644
--- a/pkg/gui/commit_message_panel.go
+++ b/pkg/gui/commit_message_panel.go
@@ -71,33 +71,6 @@ func (gui *Gui) handleCommitFocused(g *gocui.Gui, v *gocui.View) error {
return gui.renderString(g, "options", message)
}
-func (gui *Gui) simpleEditor(v *gocui.View, key gocui.Key, ch rune, mod gocui.Modifier) {
- switch {
- case key == gocui.KeyBackspace || key == gocui.KeyBackspace2:
- v.EditDelete(true)
- case key == gocui.KeyDelete:
- v.EditDelete(false)
- case key == gocui.KeyArrowDown:
- v.MoveCursor(0, 1, false)
- case key == gocui.KeyArrowUp:
- v.MoveCursor(0, -1, false)
- case key == gocui.KeyArrowLeft:
- v.MoveCursor(-1, 0, false)
- case key == gocui.KeyArrowRight:
- v.MoveCursor(1, 0, false)
- case key == gocui.KeyTab:
- v.EditNewLine()
- case key == gocui.KeySpace:
- v.EditWrite(' ')
- case key == gocui.KeyInsert:
- v.Overwrite = !v.Overwrite
- default:
- v.EditWrite(ch)
- }
-
- gui.RenderCommitLength()
-}
-
func (gui *Gui) getBufferLength(view *gocui.View) string {
return " " + strconv.Itoa(strings.Count(view.Buffer(), "")-1) + " "
}
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go
index e3aea23cb..04ed13554 100644
--- a/pkg/gui/gui.go
+++ b/pkg/gui/gui.go
@@ -459,7 +459,6 @@ func (gui *Gui) layout(g *gocui.Gui) error {
commitMessageView.Title = gui.Tr.SLocalize("CommitMessage")
commitMessageView.FgColor = gocui.ColorWhite
commitMessageView.Editable = true
- commitMessageView.Editor = gocui.EditorFunc(gui.simpleEditor)
}
}
@@ -476,7 +475,6 @@ func (gui *Gui) layout(g *gocui.Gui) error {
credentialsView.Title = gui.Tr.SLocalize("CredentialsUsername")
credentialsView.FgColor = gocui.ColorWhite
credentialsView.Editable = true
- credentialsView.Editor = gocui.EditorFunc(gui.simpleEditor)
}
}