summaryrefslogtreecommitdiff
path: root/ui/editor.go
diff options
context:
space:
mode:
authorHubert Hirtz <hubert@hirtz.pm>2021-10-19 21:13:25 +0200
committerHubert Hirtz <hubert@hirtz.pm>2021-10-19 21:13:25 +0200
commitce78dab820c632550c7e767e4601d0d4d2e34de2 (patch)
treec14d06b0f2d44a6052e0c9d4daa294f7d61a641e /ui/editor.go
parentDon't forget to close outgoing chan on debug (diff)
Only show buffer numbers when necessary
Saves space also removed non-edition related method IsCommand out of editor.go
Diffstat (limited to 'ui/editor.go')
-rw-r--r--ui/editor.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/ui/editor.go b/ui/editor.go
index 5e3105b..f4bd247 100644
--- a/ui/editor.go
+++ b/ui/editor.go
@@ -63,12 +63,9 @@ func (e *Editor) Resize(width int) {
e.width = width
}
-func (e *Editor) IsCommand() bool {
- line := e.text[e.lineIdx]
-
- // Command can't start with two slashes because that's an escape for
- // a literal slash in the message
- return len(line) >= 1 && line[0] == '/' && !(len(line) >= 2 && line[1] == '/')
+// Content result must not be modified.
+func (e *Editor) Content() []rune {
+ return e.text[e.lineIdx]
}
func (e *Editor) TextLen() int {