]> git.lizzy.rs Git - micro.git/blobdiff - cmd/micro/messenger.go
make undothresthold a setting (part 2)
[micro.git] / cmd / micro / messenger.go
index 99c0e1f4c152fbda63bffe5e290e3c3560450c43..27f556912adccbaf6300fb0e748772db2303c46c 100644 (file)
@@ -56,6 +56,9 @@ type Messenger struct {
 
        // We have to keep track of the cursor for prompting
        cursorx int
+
+       // Is the current message a message from the gutter
+       gutterMessage bool
 }
 
 // Message sends a message to the user
@@ -169,9 +172,6 @@ func (m *Messenger) HandleEvent(event tcell.Event) {
                                m.response = string([]rune(m.response)[:m.cursorx-1]) + string(m.response[m.cursorx:])
                        }
                        m.cursorx--
-               case tcell.KeySpace:
-                       m.response += " "
-                       m.cursorx++
                case tcell.KeyRune:
                        m.response = Insert(m.response, m.cursorx, string(e.Rune()))
                        m.cursorx++
@@ -209,14 +209,19 @@ func (m *Messenger) Display() {
        }
 }
 
-const (
-       GutterInfo = iota
-       GutterWarning
-       GutterError
-)
-
+// A GutterMessage is a message displayed on the side of the editor
 type GutterMessage struct {
        lineNum int
        msg     string
        kind    int
 }
+
+// These are the different types of messages
+const (
+       // GutterInfo represents a simple info message
+       GutterInfo = iota
+       // GutterWarning represents a compiler warning
+       GutterWarning
+       // GutterError represents a compiler error
+       GutterError
+)