ruby.kak: support squiggly heredocs

Squiggly heredocs were introduced in Ruby 2.3.

They work like `<<-` but strip indentation.
This commit is contained in:
Alyssa Ross 2018-03-23 13:42:48 +00:00 committed by GitHub
parent a732037b53
commit 7c0d10f458
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,7 +22,7 @@ add-highlighter shared/ regions -default code -match-capture ruby \
literal '%[iqrswxIQRSWX]\{' \} \{ \
literal '%[iqrswxIQRSWX]\[' \] \[ \
literal '%[iqrswxIQRSWX]<' > < \
heredoc '<<-?(\w+)' '^\h*(\w+)$' '' \
heredoc '<<[-~]?(\w+)' '^\h*(\w+)$' '' \
division '[\w\)\]](/|(\h+/\h+))' '\w' '' # Help Kakoune to better detect /…/ literals
# Regular expression flags are: i → ignore case, m → multi-lines, o → only interpolate #{} blocks once, x → extended mode (ignore white spaces)