From 1356e9cb6bbf041741fb6029a08a11c35bf572b9 Mon Sep 17 00:00:00 2001 From: Alex Leferry 2 Date: Thu, 10 Jul 2014 16:03:57 +0200 Subject: [PATCH 1/3] fix nested literals highlighting --- rc/ruby.kak | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/rc/ruby.kak b/rc/ruby.kak index 734abcc8..f0f0d3fc 100644 --- a/rc/ruby.kak +++ b/rc/ruby.kak @@ -15,17 +15,17 @@ hook global BufCreate .*(([.](rb))|(irbrc)|(pryrc)|(Capfile|[.]cap)|(Gemfile)|(G # Highlighters # ‾‾‾‾‾‾‾‾‾‾‾‾ -addhl -group / multi_region -default code ruby \ - double_string '"' (?' '' +addhl -group / multi_region -default code ruby \ + double_string '"' (?' '\Q<' # Regular expression flags are: i → ignore case, m → multi-lines, o → only interpolate #{} blocks once, x → extended mode (ignore white spaces) # Literals are: i → array of symbols, q → string, r → regular expression, s → symbol, w → array of words, x → capture shell result From bbc1e1f5c263484ad164d3583db2fbe15482a81b Mon Sep 17 00:00:00 2001 From: Alex Leferry 2 Date: Thu, 10 Jul 2014 16:23:15 +0200 Subject: [PATCH 2/3] minor style fix --- rc/ruby.kak | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/rc/ruby.kak b/rc/ruby.kak index f0f0d3fc..ef92b67b 100644 --- a/rc/ruby.kak +++ b/rc/ruby.kak @@ -15,17 +15,17 @@ hook global BufCreate .*(([.](rb))|(irbrc)|(pryrc)|(Capfile|[.]cap)|(Gemfile)|(G # Highlighters # ‾‾‾‾‾‾‾‾‾‾‾‾ -addhl -group / multi_region -default code ruby \ - double_string '"' (?' '\Q<' +addhl -group / multi_region -default code ruby \ + double_string '"' (? < # Regular expression flags are: i → ignore case, m → multi-lines, o → only interpolate #{} blocks once, x → extended mode (ignore white spaces) # Literals are: i → array of symbols, q → string, r → regular expression, s → symbol, w → array of words, x → capture shell result From 4b23919e92a4ef405a9ee89ff9745478db135ca1 Mon Sep 17 00:00:00 2001 From: Alex Leferry 2 Date: Thu, 10 Jul 2014 19:16:20 +0200 Subject: [PATCH 3/3] highlight symbols in hash syntax as identifiers --- rc/ruby.kak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc/ruby.kak b/rc/ruby.kak index ef92b67b..ed13642c 100644 --- a/rc/ruby.kak +++ b/rc/ruby.kak @@ -43,8 +43,8 @@ addhl -group /ruby/regex/interpolation/content fill macro addhl -group /ruby/comment fill comment addhl -group /ruby/literal fill macro -addhl -group /ruby/code regex ([$@][a-z]\w+)|(\W\K:[a-z]\w+[=?!]?) 0:identifier -addhl -group /ruby/code regex \<(require|include)\>|\<([a-z]\w+:) 0:macro +addhl -group /ruby/code regex \<([a-z]\w+:)|([$@][a-z]\w+)|(\W\K:[a-z]\w+[=?!]?) 0:identifier +addhl -group /ruby/code regex \<(require|include)\> 0:macro addhl -group /ruby/code regex \<(attr_(reader|writer|accessor))\> 0:attribute # Keywords are collected searching for keyword_ at