From c409bce57989167eb5e17b5046fc95eac235d465 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Fri, 15 Mar 2019 16:24:44 +0000 Subject: [PATCH 1/2] Recognize Ruby identifiers beginning with _ :_foo, @_foo, $_foo, and { _foo: 1 } are all valid Ruby syntax, but were not recognized by the highlighter. --- rc/base/ruby.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/base/ruby.kak b/rc/base/ruby.kak index 1b5bc94f..41232d7a 100644 --- a/rc/base/ruby.kak +++ b/rc/base/ruby.kak @@ -38,7 +38,7 @@ add-highlighter shared/ruby/backtick/interpolation region -recurse \{ \Q#{ \} fi add-highlighter shared/ruby/regex/ default-region fill meta add-highlighter shared/ruby/regex/interpolation region -recurse \{ \Q#{ \} fill meta -add-highlighter shared/ruby/code/ regex \b([A-Za-z]\w*:(?!:))|([$@][A-Za-z]\w*)|((? Date: Fri, 15 Mar 2019 17:32:49 +0000 Subject: [PATCH 2/2] Highlight all default Ruby symbols correctly --- rc/base/ruby.kak | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/rc/base/ruby.kak b/rc/base/ruby.kak index 41232d7a..3e5cfcfa 100644 --- a/rc/base/ruby.kak +++ b/rc/base/ruby.kak @@ -13,12 +13,14 @@ hook global BufCreate .*(([.](rb))|(irbrc)|(pryrc)|(Brewfile)|(Capfile|[.]cap)|( add-highlighter shared/ruby regions add-highlighter shared/ruby/code default-region group -add-highlighter shared/ruby/double_string region '"' (??@\\])|(\$|@@?)\w+))|((?[=>]?|<((=>?)|<)?|[+\-]@?|\*\*?|===?|[/`%&!^|~]|(\w+[=?!]?)|(\[\]=?)))|([A-Z]\w*|^|\h)\K::(?=[A-Z]) 0:variable + # Commands # ‾‾‾‾‾‾‾‾