From 1b9474cd442b19355b991a680fb41f7161b1bca8 Mon Sep 17 00:00:00 2001 From: Shachaf Ben-Kiki Date: Sat, 16 Jun 2018 20:30:40 -0700 Subject: [PATCH] Fix remaining static_words and spell.kak for the new list syntax --- rc/base/d.kak | 4 ++-- rc/base/go.kak | 4 ++-- rc/base/perl.kak | 4 ++-- rc/base/ruby.kak | 4 ++-- rc/base/spell.kak | 13 +++++++------ rc/base/sql.kak | 4 ++-- rc/core/makefile.kak | 4 ++-- rc/core/python.kak | 4 ++-- rc/core/sh.kak | 4 ++-- rc/extra/dockerfile.kak | 4 ++-- rc/extra/nim.kak | 4 ++-- rc/extra/pony.kak | 8 ++++---- 12 files changed, 31 insertions(+), 30 deletions(-) diff --git a/rc/base/d.kak b/rc/base/d.kak index 0b732eb5..feb0e017 100644 --- a/rc/base/d.kak +++ b/rc/base/d.kak @@ -68,8 +68,8 @@ evaluate-commands %sh{ # Add the language's grammar to the static completion list printf %s\\n "hook global WinSetOption filetype=d %{ - set-option window static_words '${keywords}:${attributes}:${types}:${values}:${decorators}:${properties}' - }" | tr '|' ':' + set-option window static_words ${keywords} ${attributes} ${types} ${values} ${decorators} ${properties} + }" | tr '|' ' ' # Highlight keywords printf %s " diff --git a/rc/base/go.kak b/rc/base/go.kak index 61308f7b..d17b09ae 100644 --- a/rc/base/go.kak +++ b/rc/base/go.kak @@ -37,8 +37,8 @@ evaluate-commands %sh{ # Add the language's grammar to the static completion list printf %s\\n "hook global WinSetOption filetype=go %{ - set-option window static_words '${keywords}:${attributes}:${types}:${values}:${functions}' - }" | tr '|' ':' + set-option window static_words '${keywords} ${attributes} ${types} ${values} ${functions}' + }" | tr '|' ' ' # Highlight keywords printf %s " diff --git a/rc/base/perl.kak b/rc/base/perl.kak index 34b88434..d483b886 100644 --- a/rc/base/perl.kak +++ b/rc/base/perl.kak @@ -41,8 +41,8 @@ evaluate-commands %sh{ # Add the language's grammar to the static completion list printf %s\\n "hook global WinSetOption filetype=perl %{ - set-option window static_words '${keywords}:${attributes}:${values}' - }" | tr '|' ':' + set-option window static_words ${keywords} ${attributes} ${values} + }" | tr '|' ' ' # Highlight keywords printf %s " diff --git a/rc/base/ruby.kak b/rc/base/ruby.kak index b595f672..ae753ae1 100644 --- a/rc/base/ruby.kak +++ b/rc/base/ruby.kak @@ -62,8 +62,8 @@ evaluate-commands %sh{ # Add the language's grammar to the static completion list printf %s\\n "hook global WinSetOption filetype=ruby %{ - set-option window static_words '${keywords}:${attributes}:${values}:${meta}' - }" | tr '|' ':' + set-option window static_words ${keywords} ${attributes} ${values} ${meta} + }" | tr '|' ' ' # Highlight keywords printf %s " diff --git a/rc/base/spell.kak b/rc/base/spell.kak index 19fd5f7b..2fe0ddaa 100644 --- a/rc/base/spell.kak +++ b/rc/base/spell.kak @@ -42,14 +42,14 @@ Formats of language supported: fi word=$(printf %s\\n "$line" | cut -d ' ' -f 2) len=$(printf %s "$word" | wc -c) - regions="$regions:$line_num.$pos+${len}|Error" + regions="$regions $line_num.$pos+${len}|Error" ;; '') line_num=$((line_num + 1));; \*) ;; *) printf 'echo -markup %%{{Error}%s}\n' "${line}" | kak -p "${kak_session}";; esac done - printf 'set-option "buffer=%s" spell_regions %%{%s}' "${kak_bufname}" "${regions}" \ + printf 'set-option "buffer=%s" spell_regions %s' "${kak_bufname}" "${regions}" \ | kak -p "${kak_session}" } rm -rf $(dirname "$kak_opt_spell_tmp_file") @@ -62,15 +62,16 @@ define-command spell-next %{ evaluate-commands %sh{ anchor_col="${kak_selection_desc%%,*}" anchor_col="${anchor_col##*.}" - start_first="${kak_opt_spell_regions#*:}" + start_first="${kak_opt_spell_regions#* }" start_first="${start_first%%|*}" + start_first="${start_first#'}" find_next_word_desc() { ## XXX: the `spell` command adds sorted selection descriptions to the range printf %s\\n "${1}" \ - | sed -e 's/^[0-9]*://' -e 's/|[^:]*//g' -e 's/,/ /g' \ - | tr ':' '\n' \ - | while read -r start end; do + | sed -e "s/'//g" -e 's/^[0-9]* //' -e 's/|[^ ]*//g' \ + | tr ' ' '\n' \ + | while IFS=, read -r start end; do start_line="${start%.*}" start_col="${start#*.}" end_line="${end%.*}" diff --git a/rc/base/sql.kak b/rc/base/sql.kak index 2a1613a0..7338c295 100644 --- a/rc/base/sql.kak +++ b/rc/base/sql.kak @@ -80,8 +80,8 @@ evaluate-commands %sh{ # Add the language's grammar to the static completion list printf %s\\n "hook global WinSetOption filetype=sql %{ - set-option window static_words '${keywords}:${operators}:${functions}:${data_types}:${data_types_fn}:NULL' - }" | tr '|' ':' + set-option window static_words ${keywords} ${operators} ${functions} ${data_types} ${data_types_fn} NULL + }" | tr '|' ' ' # Highlight keywords printf %s " diff --git a/rc/core/makefile.kak b/rc/core/makefile.kak index c54735a0..0a4a802f 100644 --- a/rc/core/makefile.kak +++ b/rc/core/makefile.kak @@ -24,8 +24,8 @@ evaluate-commands %sh{ # Add the language's grammar to the static completion list printf %s\\n "hook global WinSetOption filetype=makefile %{ - set-option window static_words '${keywords}' - }" | tr '|' ':' + set-option window static_words ${keywords} + }" | tr '|' ' ' # Highlight keywords printf %s "add-highlighter shared/makefile/content regex \b(${keywords})\b 0:keyword" diff --git a/rc/core/python.kak b/rc/core/python.kak index de6aa479..9551ba85 100644 --- a/rc/core/python.kak +++ b/rc/core/python.kak @@ -103,8 +103,8 @@ evaluate-commands %sh{ # Add the language's grammar to the static completion list printf %s\\n "hook global WinSetOption filetype=python %{ - set-option window static_words '${values}:${meta}:${attributes}:${methods}:${exceptions}:${keywords}:${types}:${functions}' - }" | tr '|' ':' + set-option window static_words ${values} ${meta} ${attributes} ${methods} ${exceptions} ${keywords} ${types} ${functions} + }" | tr '|' ' ' # Highlight keywords printf %s " diff --git a/rc/core/sh.kak b/rc/core/sh.kak index a3289ee8..bd7e2966 100644 --- a/rc/core/sh.kak +++ b/rc/core/sh.kak @@ -23,8 +23,8 @@ evaluate-commands %sh{ # Add the language's grammar to the static completion list printf %s\\n "hook global WinSetOption filetype=sh %{ - set-option window static_words '${keywords}' - }" | tr '|' ':' + set-option window static_words ${keywords} + }" | tr '|' ' ' # Highlight keywords printf %s "add-highlighter shared/sh/code regex \b(${keywords})\b 0:keyword" diff --git a/rc/extra/dockerfile.kak b/rc/extra/dockerfile.kak index 9c127cfd..0ac746a4 100644 --- a/rc/extra/dockerfile.kak +++ b/rc/extra/dockerfile.kak @@ -25,8 +25,8 @@ evaluate-commands %sh{ # Add the language's grammar to the static completion list printf %s\\n "hook global WinSetOption filetype=dockerfile %{ - set window static_words 'ONBUILD|${keywords}' - }" | tr '|' ':' + set window static_words ONBUILD|${keywords} + }" | tr '|' ' ' # Highlight keywords printf %s " diff --git a/rc/extra/nim.kak b/rc/extra/nim.kak index cc7bb23d..128cb2d1 100644 --- a/rc/extra/nim.kak +++ b/rc/extra/nim.kak @@ -40,8 +40,8 @@ evaluate-commands %sh{ # Add the language's grammar to the static completion list printf %s\\n "hook global WinSetOption filetype=nim %{ - set-option window static_words '${keywords}:${types}:${values}' - }" | tr '|' ':' + set-option window static_words ${keywords} ${types} ${values} + }" | tr '|' ' ' # Highlight keywords printf %s " diff --git a/rc/extra/pony.kak b/rc/extra/pony.kak index 8a7b34ec..6e1602a5 100644 --- a/rc/extra/pony.kak +++ b/rc/extra/pony.kak @@ -35,11 +35,11 @@ evaluate-commands %sh{ # Add the language's grammar to the static completion list - static_words="${values}:${meta}:${keywords}:${types_decl}:${capabilities}" - static_words="${static_words}::${struct}" + static_words="${values} ${meta} ${keywords} ${types_decl} ${capabilities}" + static_words="${static_words} ${struct}" printf %s\\n "hook global WinSetOption filetype=pony %{ - set-option window static_words '${static_words}' - }" | tr '|' ':' + set-option window static_words ${static_words} + }" | tr '|' ' ' # Highlight keywords printf %s "