This commit is contained in:
Zachary Yedidia
2016-09-04 12:51:00 -04:00
4 changed files with 52 additions and 2 deletions

View File

@@ -144,11 +144,14 @@ func (m *Messenger) LetterPrompt(prompt string, responses ...rune) (rune, bool)
case tcell.KeyRune:
for _, r := range responses {
if e.Rune() == r {
m.Clear()
m.Reset()
m.hasPrompt = false
return r, false
}
}
case tcell.KeyCtrlC, tcell.KeyCtrlQ, tcell.KeyEscape:
m.hasPrompt = false
return ' ', true
}
}
@@ -242,18 +245,19 @@ func (m *Messenger) Prompt(prompt, historyType string, completionTypes ...Comple
m.HandleEvent(event, m.history[historyType])
messenger.Clear()
m.Clear()
for _, v := range tabs[curTab].views {
v.Display()
}
DisplayTabs()
messenger.Display()
m.Display()
if len(suggestions) > 1 {
m.DisplaySuggestions(suggestions)
}
screen.Show()
}
m.Clear()
m.Reset()
return response, canceled
}

File diff suppressed because one or more lines are too long

View File

@@ -172,6 +172,8 @@ func (v *View) ScrollDown(n int) {
func (v *View) CanClose(msg string, responses ...rune) bool {
if v.Buf.IsModified {
char, canceled := messenger.LetterPrompt("You have unsaved changes. "+msg, responses...)
messenger.Clear()
messenger.Reset()
if !canceled {
if char == 'y' {
return true

21
runtime/syntax/lfe.micro Normal file
View File

@@ -0,0 +1,21 @@
syntax "lfe" "lfe$" "\.lfe$"
# Parens are everywhere!
color statement "\("
color statement "\)"
# Good overrides for LFE in particular
color type "defun|define-syntax|define|defmacro|defmodule|export"
# Dirty base cases stolen from the generic lisp syntax
color constant "\ [A-Za-z][A-Za-z0-9_-]+\ "
color statement "\(([-+*/<>]|<=|>=)|'"
color constant.number "\<[0-9]+\>"
color constant.string "\"(\\.|[^"])*\""
color special "['|`][A-Za-z][A-Za-z0-9_-]+"
color constant.string "\\.?"
color comment "(^|[[:space:]]);.*"
# Some warning colors because our indents are wrong.
color ,green "[[:space:]]+$"
color ,red " + +| + +"