]> git.lizzy.rs Git - micro.git/blobdiff - cmd/micro/messenger.go
make undothresthold a setting (part 2)
[micro.git] / cmd / micro / messenger.go
index f482182f1d77def85f3ff3797f5d2c2c704ad793..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++
@@ -208,3 +208,20 @@ func (m *Messenger) Display() {
                screen.Show()
        }
 }
+
+// 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
+)