Merge remote-tracking branch 'refs/remotes/zyedidia/master'

This commit is contained in:
Nicolai
2016-12-06 21:51:33 +01:00
7 changed files with 71 additions and 9 deletions

3
.gitignore vendored
View File

@@ -1,5 +1,6 @@
./micro
micro
!cmd/micro
binaries/
tmp.sh
test/
.idea/

View File

@@ -340,6 +340,7 @@ func findAction(v string) (action func(*View, bool) bool) {
func BindKey(k, v string) {
key, ok := findKey(k)
if !ok {
TermMessage("Unknown keybinding: " + k)
return
}
if v == "ToggleHelp" {
@@ -381,7 +382,6 @@ func DefaultBindings() map[string]string {
"CtrlShiftUp": "SelectToStart",
"CtrlShiftDown": "SelectToEnd",
"Enter": "InsertNewline",
"Space": "InsertSpace",
"CtrlH": "Backspace",
"Backspace": "Backspace",
"Alt-CtrlH": "DeleteWordLeft",

File diff suppressed because one or more lines are too long

View File

@@ -889,6 +889,7 @@ func (v *View) DisplayView() {
v.drawCell(screenX-v.leftCol, screenY, ' ', nil, lineStyle)
}
}
strWidth += remainder
} else if runewidth.RuneWidth(ch) > 1 {
if screenX-v.x-v.leftCol >= v.lineNumOffset {
v.drawCell(screenX, screenY, ch, nil, lineStyle)
@@ -899,15 +900,16 @@ func (v *View) DisplayView() {
v.drawCell(screenX-v.leftCol, screenY, '<', nil, lineStyle)
}
}
strWidth += StringWidth(string(ch), tabSize)
} else {
if screenX-v.x-v.leftCol >= v.lineNumOffset {
v.drawCell(screenX-v.leftCol, screenY, ch, nil, lineStyle)
}
strWidth += StringWidth(string(ch), tabSize)
}
charNum = charNum.Move(1, v.Buf)
screenX++
colN++
strWidth += StringWidth(string(ch), tabSize)
}
// Here we are at a newline

View File

@@ -4,6 +4,7 @@ color-link comment "#75715E,#282828"
color-link identifier "#66D9EF,#282828"
color-link constant "#AE81FF,#282828"
color-link constant.string "#E6DB74,#282828"
color-link constant.string.char "#BDE6AD,#282828"
color-link statement "#F92672,#282828"
color-link preproc "#CB4B16,#282828"
color-link type "#66D9EF,#282828"

View File

@@ -3,6 +3,7 @@ color-link comment "#75715E,#282828"
color-link identifier "#66D9EF,#282828"
color-link constant "#AE81FF,#282828"
color-link constant.string "#E6DB74,#282828"
color-link constant.string.char "#BDE6AD,#282828"
color-link statement "#F92672,#282828"
color-link preproc "#CB4B16,#282828"
color-link type "#66D9EF,#282828"

View File

@@ -0,0 +1,34 @@
## Crystal Syntax file.
##
syntax "crystal" "\.cr$" "Gemfile" "config.ru" "Rakefile" "Capfile" "Vagrantfile"
header "^#!.*/(env +)?crystal( |$)"
## Asciibetical list of reserved words
color statement "\b(BEGIN|END|abstract|alias|and|begin|break|case|class|def|defined\?|do|else|elsif|end|ensure|enum|false|for|fun|if|in|include|lib|loop|macro|module|next|nil|not|of|or|pointerof|private|protected|raise|redo|require|rescue|retry|return|self|sizeof|spawn|struct|super|then|true|type|undef|union|uninitialized|unless|until|when|while|yield)\b"
## Constants
color constant "(\$|@|@@)?\b[A-Z]+[0-9A-Z_a-z]*"
color constant.number "\b[0-9]+\b"
## Crystal "symbols"
color constant (i) "([ ]|^):[0-9A-Z_]+\b"
## Some unique things we want to stand out
color constant "\b(__FILE__|__LINE__)\b"
## Regular expressions
color constant "/([^/]|(\\/))*/[iomx]*" "%r\{([^}]|(\\}))*\}[iomx]*"
## Shell command expansion is in `backticks` or like %x{this}. These are
## "double-quotish" (to use a perlism).
color constant.string "`[^`]*`" "%x\{[^}]*\}"
## Strings, double-quoted
color constant.string ""([^"]|(\\"))*"" "%[QW]?\{[^}]*\}" "%[QW]?\([^)]*\)" "%[QW]?<[^>]*>" "%[QW]?\[[^]]*\]" "%[QW]?\$[^$]*\$" "%[QW]?\^[^^]*\^" "%[QW]?![^!]*!"
## Expression substitution. These go inside double-quoted strings,
## "like #{this}".
color special "#\{[^}]*\}"
## Characters are single-quoted
color constant.string.char "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>" "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!"
## Comments
color comment "#[^{].*$" "#$"
color comment "##[^{].*$" "##$"
## "Here" docs
color constant start="<<-?'?EOT'?" end="^EOT"
## Some common markers
color todo "(XXX|TODO|FIXME|\?\?\?)"