Rename highlighters that used an underscore to use a dash

For example `show_matching` is now `show-matching`.
This commit is contained in:
Maxime Coste 2018-07-08 19:11:04 +10:00
parent 3617509b4a
commit 79ec8d0010
13 changed files with 27 additions and 23 deletions

View File

@ -67,6 +67,10 @@ change to make Kakoune command model cleaner and more robust.
See <<highlighters#,`:doc highlighters`>> See <<highlighters#,`:doc highlighters`>>
* Highlighter type names have been unified, types that used `_` as
word separators, such as `show_whitespaces` are now using `-`
(`show-whitespace`).
* `a` on end of line is not treated specially anymore, it will start * `a` on end of line is not treated specially anymore, it will start
inserting on the next character, which will be the first character inserting on the next character, which will be the first character
of the next line. of the next line.

View File

@ -105,7 +105,7 @@ The following faces are used by builtin highlighters if enabled.
(See <<highlighters#,`:doc highlighters`>>. (See <<highlighters#,`:doc highlighters`>>.
*LineNumbers*:: *LineNumbers*::
face used by the `number_lines` highlighter face used by the `number-lines` highlighter
*LineNumberCursor*:: *LineNumberCursor*::
face used to highlight the line number of the main selection face used to highlight the line number of the main selection
@ -114,7 +114,7 @@ The following faces are used by builtin highlighters if enabled.
face used to highlight the line number of wrapped lines face used to highlight the line number of wrapped lines
*MatchingChar*:: *MatchingChar*::
face used by the `show_matching` highlighter face used by the `show-matching` highlighter
*Whitespace*:: *Whitespace*::
face used by the `show_whitespaces` highlighter face used by the `show-whitespaces` highlighter

View File

@ -25,11 +25,11 @@ from the remaining parameters.
== Convenient highlighters == Convenient highlighters
*show_matching*:: *show-matching*::
highlight matching char of the character under the selections' cursor highlight matching char of the character under the selections' cursor
using `MatchingChar` face using `MatchingChar` face
*show_whitespaces* [options]:: *show-whitespaces* [options]::
display symbols on top of whitespaces to make them more explicit display symbols on top of whitespaces to make them more explicit
using the `Whitespace` face, with the following *options*: using the `Whitespace` face, with the following *options*:
@ -48,7 +48,7 @@ from the remaining parameters.
*-tabpad* <separator>::: *-tabpad* <separator>:::
a one character long separator that will be appended to tabulations to honor the *tabstop* option a one character long separator that will be appended to tabulations to honor the *tabstop* option
*number_lines* [options]:: *number-lines* [options]::
show line numbers using the `LineNumbers`, `LineNumberCursor` and `LineNumbersWrapped` faces, show line numbers using the `LineNumbers`, `LineNumberCursor` and `LineNumbersWrapped` faces,
with the following *options*: with the following *options*:
@ -115,7 +115,7 @@ git blame output or spelling typos.
See <<options#types,`:doc options types`>> for the format of `line-specs` See <<options#types,`:doc options types`>> for the format of `line-specs`
and `range-specs`. and `range-specs`.
*flag_lines* <face> <option_name>:: *flag-lines* <face> <option_name>::
add columns in front of the buffer, and display the flags specified add columns in front of the buffer, and display the flags specified
in `line-specs` option, using <face>. in `line-specs` option, using <face>.
In this example two words will be added in the gutter: a blue Foo at In this example two words will be added in the gutter: a blue Foo at
@ -124,7 +124,7 @@ and `range-specs`.
---------------------------------------------------------------------- ----------------------------------------------------------------------
declare-option line-specs my_flags declare-option line-specs my_flags
set-option window my_flags "%val{timestamp}:1|Foo:3|{red,yellow+b}Bar" set-option window my_flags "%val{timestamp}:1|Foo:3|{red,yellow+b}Bar"
add-highlighter window/ flag_lines blue my_flags add-highlighter window/ flag-lines blue my_flags
---------------------------------------------------------------------- ----------------------------------------------------------------------
*ranges* <option_name>:: *ranges* <option_name>::

View File

@ -87,7 +87,7 @@ define-command -hidden lint-show-counters %{
} }
define-command lint-enable -docstring "Activate automatic diagnostics of the code" %{ define-command lint-enable -docstring "Activate automatic diagnostics of the code" %{
add-highlighter window/lint flag_lines default lint_flags add-highlighter window/lint flag-lines default lint_flags
hook window -group lint-diagnostics NormalIdle .* %{ lint-show } hook window -group lint-diagnostics NormalIdle .* %{ lint-show }
hook window -group lint-diagnostics WinSetOption lint_flags=.* %{ info; lint-show } hook window -group lint-diagnostics WinSetOption lint_flags=.* %{ info; lint-show }
} }

View File

@ -35,7 +35,7 @@ evaluate-commands %sh{
change-directory rename-session colorscheme declare-user-mode enter-user-mode" change-directory rename-session colorscheme declare-user-mode enter-user-mode"
attributes="global buffer window current attributes="global buffer window current
normal insert menu prompt goto view user object normal insert menu prompt goto view user object
number_lines show_matching show_whitespaces fill regex dynregex group flag_lines number-lines show-matching show-whitespaces fill regex dynregex group flag-lines
ranges line column wrap ref regions region default-region replace-ranges" ranges line column wrap ref regions region default-region replace-ranges"
types="int bool str regex int-list str-list completions line-specs range-specs" types="int bool str regex int-list str-list completions line-specs range-specs"
values="default black red green yellow blue magenta cyan white yes no false true" values="default black red green yellow blue magenta cyan white yes no false true"

View File

@ -150,7 +150,7 @@ define-command -hidden clang-show-error-info %{
define-command clang-enable-diagnostics -docstring %{Activate automatic error reporting and diagnostics define-command clang-enable-diagnostics -docstring %{Activate automatic error reporting and diagnostics
Information about the analysis are showned after the buffer has been parsed with the clang-parse function} \ Information about the analysis are showned after the buffer has been parsed with the clang-parse function} \
%{ %{
add-highlighter window/clang_flags flag_lines default clang_flags add-highlighter window/clang_flags flag-lines default clang_flags
hook window -group clang-diagnostics NormalIdle .* %{ clang-show-error-info } hook window -group clang-diagnostics NormalIdle .* %{ clang-show-error-info }
hook window -group clang-diagnostics WinSetOption ^clang_errors=.* %{ info; clang-show-error-info } hook window -group clang-diagnostics WinSetOption ^clang_errors=.* %{ info; clang-show-error-info }
} }

View File

@ -63,7 +63,7 @@ Available commands:\n add\n rm\n blame\n commit\n checkout\n diff\n hide-
run_git_blame() { run_git_blame() {
( (
printf %s "evaluate-commands -client '$kak_client' %{ printf %s "evaluate-commands -client '$kak_client' %{
try %{ add-highlighter window/git-blame flag_lines GitBlame git_blame_flags } try %{ add-highlighter window/git-blame flag-lines GitBlame git_blame_flags }
set-option buffer=$kak_bufname git_blame_flags '$kak_timestamp' set-option buffer=$kak_bufname git_blame_flags '$kak_timestamp'
}" | kak -p ${kak_session} }" | kak -p ${kak_session}
git blame "$@" --incremental ${kak_buffile} | awk ' git blame "$@" --incremental ${kak_buffile} | awk '
@ -185,7 +185,7 @@ Available commands:\n add\n rm\n blame\n commit\n checkout\n diff\n hide-
}" }"
;; ;;
show-diff) show-diff)
echo 'try %{ add-highlighter window/git-diff flag_lines GitDiffFlags git_diff_flags }' echo 'try %{ add-highlighter window/git-diff flag-lines GitDiffFlags git_diff_flags }'
update_diff update_diff
;; ;;
update-diff) update_diff ;; update-diff) update_diff ;;

View File

@ -1061,7 +1061,7 @@ struct LineNumbersHighlighter : Highlighter
} }
private: private:
static constexpr StringView ms_id = "line_numbers"; static constexpr StringView ms_id = "line-numbers";
void do_highlight(HighlightContext context, DisplayBuffer& display_buffer, BufferRange) override void do_highlight(HighlightContext context, DisplayBuffer& display_buffer, BufferRange) override
{ {
@ -2136,16 +2136,16 @@ void register_highlighters()
HighlighterRegistry& registry = HighlighterRegistry::instance(); HighlighterRegistry& registry = HighlighterRegistry::instance();
registry.insert({ registry.insert({
"number_lines", "number-lines",
{ LineNumbersHighlighter::create, { LineNumbersHighlighter::create,
"Display line numbers \n" "Display line numbers \n"
"Parameters: -relative, -hlcursor, -separator <separator text>\n" } }); "Parameters: -relative, -hlcursor, -separator <separator text>\n" } });
registry.insert({ registry.insert({
"show_matching", "show-matching",
{ create_matching_char_highlighter, { create_matching_char_highlighter,
"Apply the MatchingChar face to the char matching the one under the cursor" } }); "Apply the MatchingChar face to the char matching the one under the cursor" } });
registry.insert({ registry.insert({
"show_whitespaces", "show-whitespaces",
{ show_whitespaces_factory, { show_whitespaces_factory,
"Display whitespaces using symbols \n" "Display whitespaces using symbols \n"
"Parameters: -tab <separator> -tabpad <separator> -lf <separator> -spc <separator> -nbsp <separator>\n" } }); "Parameters: -tab <separator> -tabpad <separator> -lf <separator> -spc <separator> -nbsp <separator>\n" } });
@ -2171,7 +2171,7 @@ void register_highlighters()
"<passes> is a flags(colorize|move|wrap) defaulting to colorize\n" "<passes> is a flags(colorize|move|wrap) defaulting to colorize\n"
"which specify what kind of highlighters can be put in the group" } }); "which specify what kind of highlighters can be put in the group" } });
registry.insert({ registry.insert({
"flag_lines", "flag-lines",
{ FlagLinesHighlighter::create, { FlagLinesHighlighter::create,
"Parameters: <face> <option name>\n" "Parameters: <face> <option name>\n"
"Display flags specified in the line-spec option <option name> with <face>"} }); "Display flags specified in the line-spec option <option name> with <face>"} });

View File

@ -1,4 +1,4 @@
add-highlighter window/ number_lines add-highlighter window/ number-lines
set window tabstop 4 set window tabstop 4
add-highlighter window/ column 3 default,red add-highlighter window/ column 3 default,red
add-highlighter window/ column 7 default,green add-highlighter window/ column 7 default,green

View File

@ -1 +1 @@
:addhl window show_whitespaces<ret>i<space><esc>:addhl window column 1 red<ret>A<backspace><esc> :addhl window show-whitespaces<ret>i<space><esc>:addhl window column 1 red<ret>A<backspace><esc>

View File

@ -1 +1 @@
add-highlighter window/ show_whitespaces add-highlighter window/ show-whitespaces

View File

@ -1 +1 @@
add-highlighter window/ show_whitespaces add-highlighter window/ show-whitespaces

View File

@ -1 +1 @@
add-highlighter window/ number_lines add-highlighter window/ number-lines