Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
zyedidia committed Aug 12, 2020
2 parents 6b80870 + 5cb618c commit c5bafbc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
7 changes: 6 additions & 1 deletion internal/action/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,12 @@ func (h *BufPane) ShowKeyCmd(args []string) {
return
}

if action, ok := config.Bindings[args[0]]; ok {
event, err := findEvent(args[0])
if err != nil {
InfoBar.Error(err)
return
}
if action, ok := config.Bindings[event.Name()]; ok {
InfoBar.Message(action)
} else {
InfoBar.Message(args[0], " has no binding")
Expand Down
10 changes: 7 additions & 3 deletions runtime/syntax/rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@ rules:
# function definition
- identifier: "fn [a-z0-9_]+"
# Reserved words
- statement: "\\b(abstract|alignof|as|become|box|break|const|continue|crate|do|else|enum|extern|false|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|offsetof|override|priv|pub|pure|ref|return|sizeof|static|self|struct|super|true|trait|type|typeof|unsafe|unsized|use|virtual|where|while|yield)\\b"
- statement: "\\b(abstract|alignof|as|become|box|break|const|continue|crate|do|dyn|else|enum|extern|false|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|offsetof|override|priv|pub|pure|ref|return|sizeof|static|self|struct|super|true|trait|type|typeof|unsafe|unsized|use|virtual|where|while|yield)\\b"
# macros
- special: "[a-z_]+!"
# Constants
- constant: "[A-Z][A-Z_]+"
- constant: "\\b[A-Z][A-Z_0-9]+\\b"
# Numbers
- constant.number: "\\b[0-9]+\\b"
# Booleans
- constant: "\\b(true|false)\\b"
# Traits/Enums/Structs/Types/etc.
- type: "[A-Z][a-z]+"
- type: "\\b[A-Z]+[a-zA-Z_0-9]*[a-z]+[a-zA-Z_0-9]*\\b"
# Builtin types that start with lowercase.
- type: "\\b(bool|str|isize|usize|((i|u)(8|16|32|64))|f32|f64)\\b"

- constant.string:
start: "\""
Expand Down

0 comments on commit c5bafbc

Please sign in to comment.