diff --git a/rc/filetype/rust.kak b/rc/filetype/rust.kak index 049fc444..d7ff4952 100644 --- a/rc/filetype/rust.kak +++ b/rc/filetype/rust.kak @@ -39,10 +39,9 @@ add-highlighter shared/rust/line_doctest region ^\h*//[!/]\h*```($|should_panic| add-highlighter shared/rust/line_doctest/marker region ```.* $ group add-highlighter shared/rust/line_doctest/marker/fence regex ``` 0:meta add-highlighter shared/rust/line_doctest/marker/keywords regex [\d\w] 0:meta # already matched above, just ignore comma -add-highlighter shared/rust/line_doctest/inner region '^\h*//[!/]\h+#' ' ' group +add-highlighter shared/rust/line_doctest/inner region '^\h*//[!/]( #(?= )|)' '$| ' group add-highlighter shared/rust/line_doctest/inner/comment regex //[!/] 0:documentation add-highlighter shared/rust/line_doctest/inner/hidden regex '#' 0:meta -add-highlighter shared/rust/line_doctest/comment region ^\h*//[!/] ' ' fill documentation add-highlighter shared/rust/line_doctest/code default-region ref rust add-highlighter shared/rust/line_code_rest region ^\h*//[!/]\h*``` ^\h*//[!/]\h*```$ fill documentation # reset invalid doctest add-highlighter shared/rust/line_comment2 region //[!/]{2} $ fill comment @@ -68,7 +67,6 @@ add-highlighter shared/rust/macro_attributes/ default-region fill meta add-highlighter shared/rust/macro_attributes/string region %{(? s ^\h*//[!/]{0,2}\h* y gh j P + try %[ # line comment + evaluate-commands -draft -save-regs '/"' %[ + # copy the commenting prefix + execute-keys -save-regs '' k s ^\h*//[!/]{0,2}\h* y + try %[ + # if the previous comment isn't empty, create a new one + execute-keys ^\h*//[!/]{0,2}$ js^\h*P + ] catch %[ + # TODO figure out a way to not delete empty comment in current line + # if there is no space and text in the previous comment, remove it completely + execute-keys s //.* d + ] + ] + ] catch %[ # block comment + # if the previous line isn't within a comment scope, break + execute-keys -draft k ^(\h*/\*|\h+\*(?!/)) + + # find comment opening, validate it was not closed, and check its using star prefixes + execute-keys -draft /\* \*/ \A\h*/\*([^\n]*\n\h*\*)*[^\n]*\n\h*.\z + + try %[ + # if the previous line is opening the comment, insert star preceeded by space + execute-keys -draft k^\h*/\* + execute-keys -draft i* + ] catch %[ + try %[ + # if the next line is a comment line insert a star + execute-keys -draft j^\h+\* + execute-keys -draft i* + ] catch %[ + try %[ + # if the previous line is an empty comment line, close the comment scope + execute-keys -draft k^\h+\*\h+$ 1s\*(\h*)c/ + ] catch %[ + # if the previous line is a non-empty comment line, add a star + execute-keys -draft i* + ] + ] + ] + + # trim trailing whitespace on the previous line + try %[ execute-keys -draft s\h+$ d ] + # align the new star with the previous one + execute-keys K1s^[^*]*(\*)& + ] } catch %` # preserve previous line indent try %{ execute-keys -draft K } @@ -129,7 +173,7 @@ define-command -hidden rust-indent-on-opening-curly-brace %[ evaluate-commands -draft -itersel %_ # align indent with opening paren when { is entered on a new line after the closing paren try %[ execute-keys -draft h ) M \A\(.*\)\h*\n\h*\{\z s \A|.\z 1 ] - # dedent standalone { after impl or fn block without any { in between + # dedent standalone { after impl and related block without any { in between try %< execute-keys -draft hh impl|fn|struct|enum|union \{ ll ^\h*\{$ > _ ] diff --git a/test/highlight/rust/comment/in b/test/highlight/rust/comment/in deleted file mode 100644 index 2ce32f0a..00000000 --- a/test/highlight/rust/comment/in +++ /dev/null @@ -1,88 +0,0 @@ -//! # Hello World -//! -//! ```shell -//! $ cargo install -//! ``` -//! -//! ``` -//! # use foo; -//! foo::bar("Hello world"); -//! ``` - -//!! ``` -//!! foo::bar("Hello world"); -//!! ``` - -//// ``` -//// foo::bar("Hello world"); -//// ``` - -// ``` -// foo::bar("Hello world"); -// ``` - -// make sure the color does not break -/// ``` -/// # use foo; -/// foo::bar("Hello world"); -/// ``` -fn bar(s: &str) { - println!("{}", s); -} - - /// ```shell - /// $ cargo install - /// ``` - /// - /// ```edition2018,no_run - /// # use foo; - /// foo::bar("Hello world"); - /// ``` - /// - /// ``` - /// # use foo; - /// foo::bar("Hello world"); - /// ``` - - //!! ``` - //!! foo::bar("Hello world"); - //!! ``` - - //// ``` - //// foo::bar("Hello world"); - //// ``` - - // ``` - // foo::bar("Hello world"); - // ``` - - /** - * ```shell - * $ cargo install - * ``` - * - * ```edition2018,no_run - * # use foo; - * foo::bar("Hello world"); - * ``` - */ - - /** - ``` - # use foo; - foo::bar("Hello world"); - ``` - */ - - /*** - * ``` - * foo::bar("Hello world"); - * ``` - */ - - /* - * ``` - * foo::bar("Hello world"); - * ``` - */ - diff --git a/test/highlight/rust/comment/script b/test/highlight/rust/comment/script deleted file mode 100644 index 560e4d98..00000000 --- a/test/highlight/rust/comment/script +++ /dev/null @@ -1,7 +0,0 @@ -ui_out '{ "jsonrpc": "2.0", "method": "set_ui_options", "params": [{}] }' -ui_out '{ "jsonrpc": "2.0", "method": "draw", "params": [[[{ "face": { "fg": "black", "bg": "white", "attributes": ["final_fg","final_bg"] }, "contents": "/" }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "/! # Hello World" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//!" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//! ```shell\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//! $ cargo install\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//! ```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//!" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//! " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//!" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "#" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "blue", "bg": "default", "attributes": [] }, "contents": "use" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " foo;\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//! " }, { "face": { "fg": "green", "bg": "default", "attributes": [] }, "contents": "foo" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "::" }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "bar" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "(" }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "\"Hello world\"" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": ");\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//! " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//!! ```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//!! foo::bar(\"Hello world\");" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//!! ```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//// ```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//// foo::bar(\"Hello world\");" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//// ```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "// ```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "// foo::bar(\"Hello world\");" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "// ```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "// make sure the color does not break" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }]], { "fg": "default", "bg": "default", "attributes": [] }, { "fg": "blue", "bg": "default", "attributes": [] }] }' -ui_out '{ "jsonrpc": "2.0", "method": "menu_hide", "params": [] }' -ui_out '{ "jsonrpc": "2.0", "method": "info_hide", "params": [] }' -ui_out '{ "jsonrpc": "2.0", "method": "draw_status", "params": [[], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "out 1:1 " }, { "face": { "fg": "black", "bg": "yellow", "attributes": [] }, "contents": "" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "blue", "bg": "default", "attributes": [] }, "contents": "1 sel" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " - client0@[kak-tests]" }], { "fg": "cyan", "bg": "default", "attributes": [] }] }' -ui_out '{ "jsonrpc": "2.0", "method": "set_cursor", "params": ["buffer", { "line": 0, "column": 0 }] }' -ui_out '{ "jsonrpc": "2.0", "method": "refresh", "params": [true] }' diff --git a/test/highlight/rust/comment/cmd b/test/highlight/rust/comment0/cmd similarity index 100% rename from test/highlight/rust/comment/cmd rename to test/highlight/rust/comment0/cmd diff --git a/test/highlight/rust/comment0/in b/test/highlight/rust/comment0/in new file mode 100644 index 00000000..88298fed --- /dev/null +++ b/test/highlight/rust/comment0/in @@ -0,0 +1,8 @@ +// make sure the color does not break +/// ``` +/// # use foo; +/// foo::bar("Hello world"); +/// ``` +fn bar(s: &str) { + println!("{}", s); +} diff --git a/test/highlight/rust/comment/rc b/test/highlight/rust/comment0/rc similarity index 100% rename from test/highlight/rust/comment/rc rename to test/highlight/rust/comment0/rc diff --git a/test/highlight/rust/comment0/script b/test/highlight/rust/comment0/script new file mode 100644 index 00000000..9de740ab --- /dev/null +++ b/test/highlight/rust/comment0/script @@ -0,0 +1,7 @@ +ui_out '{ "jsonrpc": "2.0", "method": "set_ui_options", "params": [{}] }' +ui_out '{ "jsonrpc": "2.0", "method": "draw", "params": [[[{ "face": { "fg": "black", "bg": "white", "attributes": ["final_fg","final_bg"] }, "contents": "/" }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "/ make sure the color does not break" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "///" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "///" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "#" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "blue", "bg": "default", "attributes": [] }, "contents": "use" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " foo;\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "///" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "green", "bg": "default", "attributes": [] }, "contents": "foo" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "::" }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "bar" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "(" }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "\"Hello world\"" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": ");\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "///" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "blue", "bg": "default", "attributes": [] }, "contents": "fn" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "bar" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "(" }, { "face": { "fg": "green", "bg": "default", "attributes": [] }, "contents": "s" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": ": &" }, { "face": { "fg": "yellow", "bg": "default", "attributes": [] }, "contents": "str" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": ") {\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "println!" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "(" }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "\"{}\"" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": ", s);\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "}\u000a" }]], { "fg": "default", "bg": "default", "attributes": [] }, { "fg": "blue", "bg": "default", "attributes": [] }] }' +ui_out '{ "jsonrpc": "2.0", "method": "menu_hide", "params": [] }' +ui_out '{ "jsonrpc": "2.0", "method": "info_hide", "params": [] }' +ui_out '{ "jsonrpc": "2.0", "method": "draw_status", "params": [[], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "out 1:1 " }, { "face": { "fg": "black", "bg": "yellow", "attributes": [] }, "contents": "" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "blue", "bg": "default", "attributes": [] }, "contents": "1 sel" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " - client0@[kak-tests]" }], { "fg": "cyan", "bg": "default", "attributes": [] }] }' +ui_out '{ "jsonrpc": "2.0", "method": "set_cursor", "params": ["buffer", { "line": 0, "column": 0 }] }' +ui_out '{ "jsonrpc": "2.0", "method": "refresh", "params": [true] }' diff --git a/test/highlight/rust/doc_comment_hidden/cmd b/test/highlight/rust/doc_comment_hidden/cmd new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/test/highlight/rust/doc_comment_hidden/cmd @@ -0,0 +1 @@ + diff --git a/test/highlight/rust/doc_comment_hidden/in b/test/highlight/rust/doc_comment_hidden/in new file mode 100644 index 00000000..37cc3c31 --- /dev/null +++ b/test/highlight/rust/doc_comment_hidden/in @@ -0,0 +1,15 @@ + //! ``` + //! // not hidden # + //! #![feature(x)] + //! # // hidden # + //! # #![feature(x)] + //! ``` + + /** + * ``` + * // not hidden # + * #![feature(x)] + * # // hidden # + * # #![feature(x)] + * ``` + */ diff --git a/test/indent/rust/comment/rc b/test/highlight/rust/doc_comment_hidden/rc similarity index 100% rename from test/indent/rust/comment/rc rename to test/highlight/rust/doc_comment_hidden/rc diff --git a/test/highlight/rust/doc_comment_hidden/script b/test/highlight/rust/doc_comment_hidden/script new file mode 100644 index 00000000..5ae5f540 --- /dev/null +++ b/test/highlight/rust/doc_comment_hidden/script @@ -0,0 +1,7 @@ +ui_out '{ "jsonrpc": "2.0", "method": "set_ui_options", "params": [{}] }' +ui_out '{ "jsonrpc": "2.0", "method": "draw", "params": [[[{ "face": { "fg": "black", "bg": "white", "attributes": ["final_fg","final_bg"] }, "contents": " " }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//!" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//!" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "// not hidden #" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//!" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "#![feature(x)]" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//!" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "#" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "// hidden #" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//!" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "#" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "#![feature(x)]" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//!" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "/**\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " * " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " *" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "// not hidden #" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " *" }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": " #![feature(x)]" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " *" }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": " #" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "// hidden #" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " *" }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": " #" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "#![feature(x)]" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " *" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "```" }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " */" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }]], { "fg": "default", "bg": "default", "attributes": [] }, { "fg": "blue", "bg": "default", "attributes": [] }] }' +ui_out '{ "jsonrpc": "2.0", "method": "menu_hide", "params": [] }' +ui_out '{ "jsonrpc": "2.0", "method": "info_hide", "params": [] }' +ui_out '{ "jsonrpc": "2.0", "method": "draw_status", "params": [[], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "out 1:1 " }, { "face": { "fg": "black", "bg": "yellow", "attributes": [] }, "contents": "" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "blue", "bg": "default", "attributes": [] }, "contents": "1 sel" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " - client0@[kak-tests]" }], { "fg": "cyan", "bg": "default", "attributes": [] }] }' +ui_out '{ "jsonrpc": "2.0", "method": "set_cursor", "params": ["buffer", { "line": 0, "column": 0 }] }' +ui_out '{ "jsonrpc": "2.0", "method": "refresh", "params": [true] }' diff --git a/test/highlight/rust/doc_comment_hidden_with_empty_line/cmd b/test/highlight/rust/doc_comment_hidden_with_empty_line/cmd new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/test/highlight/rust/doc_comment_hidden_with_empty_line/cmd @@ -0,0 +1 @@ + diff --git a/test/highlight/rust/doc_comment_hidden_with_empty_line/in b/test/highlight/rust/doc_comment_hidden_with_empty_line/in new file mode 100644 index 00000000..163b6424 --- /dev/null +++ b/test/highlight/rust/doc_comment_hidden_with_empty_line/in @@ -0,0 +1,13 @@ + /// ``` + /// println!("empty line"); + /// + /// println!("continue line"); + /// ``` + + /** + * ``` + * println!("empty line"); + * + * println!("continue line"); + * ``` + */ diff --git a/test/highlight/rust/doc_comment_hidden_with_empty_line/rc b/test/highlight/rust/doc_comment_hidden_with_empty_line/rc new file mode 100644 index 00000000..64064c25 --- /dev/null +++ b/test/highlight/rust/doc_comment_hidden_with_empty_line/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/rust.kak" +set buffer filetype rust diff --git a/test/highlight/rust/doc_comment_hidden_with_empty_line/script b/test/highlight/rust/doc_comment_hidden_with_empty_line/script new file mode 100644 index 00000000..5e4cf3f6 --- /dev/null +++ b/test/highlight/rust/doc_comment_hidden_with_empty_line/script @@ -0,0 +1,7 @@ +ui_out '{ "jsonrpc": "2.0", "method": "set_ui_options", "params": [{}] }' +ui_out '{ "jsonrpc": "2.0", "method": "draw", "params": [[[{ "face": { "fg": "black", "bg": "white", "attributes": ["final_fg","final_bg"] }, "contents": " " }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "///" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "///" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "println!" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "(" }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "\"empty line\"" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": ");\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "///" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "///" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "println!" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "(" }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "\"continue line\"" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": ");\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "///" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "/**\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " * " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " *" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "println!" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "(" }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "\"empty line\"" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": ");\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " *" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " *" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "println!" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "(" }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "\"continue line\"" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": ");\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " *" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "```" }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " */" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }]], { "fg": "default", "bg": "default", "attributes": [] }, { "fg": "blue", "bg": "default", "attributes": [] }] }' +ui_out '{ "jsonrpc": "2.0", "method": "menu_hide", "params": [] }' +ui_out '{ "jsonrpc": "2.0", "method": "info_hide", "params": [] }' +ui_out '{ "jsonrpc": "2.0", "method": "draw_status", "params": [[], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "out 1:1 " }, { "face": { "fg": "black", "bg": "yellow", "attributes": [] }, "contents": "" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "blue", "bg": "default", "attributes": [] }, "contents": "1 sel" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " - client0@[kak-tests]" }], { "fg": "cyan", "bg": "default", "attributes": [] }] }' +ui_out '{ "jsonrpc": "2.0", "method": "set_cursor", "params": ["buffer", { "line": 0, "column": 0 }] }' +ui_out '{ "jsonrpc": "2.0", "method": "refresh", "params": [true] }' diff --git a/test/highlight/rust/inner_block_comment1/cmd b/test/highlight/rust/inner_block_comment1/cmd new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/test/highlight/rust/inner_block_comment1/cmd @@ -0,0 +1 @@ + diff --git a/test/highlight/rust/inner_block_comment1/in b/test/highlight/rust/inner_block_comment1/in new file mode 100644 index 00000000..ad255bdd --- /dev/null +++ b/test/highlight/rust/inner_block_comment1/in @@ -0,0 +1,11 @@ + /*** + * ``` + * foo::bar("Hello world"); + * ``` + */ + + /* + * ``` + * foo::bar("Hello world"); + * ``` + */ diff --git a/test/highlight/rust/inner_block_comment1/rc b/test/highlight/rust/inner_block_comment1/rc new file mode 100644 index 00000000..64064c25 --- /dev/null +++ b/test/highlight/rust/inner_block_comment1/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/rust.kak" +set buffer filetype rust diff --git a/test/highlight/rust/inner_block_comment1/script b/test/highlight/rust/inner_block_comment1/script new file mode 100644 index 00000000..6a5a3d0e --- /dev/null +++ b/test/highlight/rust/inner_block_comment1/script @@ -0,0 +1,7 @@ +ui_out '{ "jsonrpc": "2.0", "method": "set_ui_options", "params": [{}] }' +ui_out '{ "jsonrpc": "2.0", "method": "draw", "params": [[[{ "face": { "fg": "black", "bg": "white", "attributes": ["final_fg","final_bg"] }, "contents": " " }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "/***\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " * ```\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " * foo::bar(\"Hello world\");\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " * ```\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " */" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "/*\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " * ```\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " * foo::bar(\"Hello world\");\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " * ```\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " */" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }]], { "fg": "default", "bg": "default", "attributes": [] }, { "fg": "blue", "bg": "default", "attributes": [] }] }' +ui_out '{ "jsonrpc": "2.0", "method": "menu_hide", "params": [] }' +ui_out '{ "jsonrpc": "2.0", "method": "info_hide", "params": [] }' +ui_out '{ "jsonrpc": "2.0", "method": "draw_status", "params": [[], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "out 1:1 " }, { "face": { "fg": "black", "bg": "yellow", "attributes": [] }, "contents": "" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "blue", "bg": "default", "attributes": [] }, "contents": "1 sel" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " - client0@[kak-tests]" }], { "fg": "cyan", "bg": "default", "attributes": [] }] }' +ui_out '{ "jsonrpc": "2.0", "method": "set_cursor", "params": ["buffer", { "line": 0, "column": 0 }] }' +ui_out '{ "jsonrpc": "2.0", "method": "refresh", "params": [true] }' diff --git a/test/highlight/rust/inner_block_doc_comment1/cmd b/test/highlight/rust/inner_block_doc_comment1/cmd new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/test/highlight/rust/inner_block_doc_comment1/cmd @@ -0,0 +1 @@ + diff --git a/test/highlight/rust/inner_block_doc_comment1/in b/test/highlight/rust/inner_block_doc_comment1/in new file mode 100644 index 00000000..1ede5fc2 --- /dev/null +++ b/test/highlight/rust/inner_block_doc_comment1/in @@ -0,0 +1,17 @@ + /** + * ```shell + * $ cargo install + * ``` + * + * ```edition2018,no_run + * # use foo; + * foo::bar("Hello world"); + * ``` + */ + + /** + ``` + # use foo; + foo::bar("Hello world"); + ``` + */ diff --git a/test/highlight/rust/inner_block_doc_comment1/rc b/test/highlight/rust/inner_block_doc_comment1/rc new file mode 100644 index 00000000..64064c25 --- /dev/null +++ b/test/highlight/rust/inner_block_doc_comment1/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/rust.kak" +set buffer filetype rust diff --git a/test/highlight/rust/inner_block_doc_comment1/script b/test/highlight/rust/inner_block_doc_comment1/script new file mode 100644 index 00000000..ece62ee7 --- /dev/null +++ b/test/highlight/rust/inner_block_doc_comment1/script @@ -0,0 +1,7 @@ +ui_out '{ "jsonrpc": "2.0", "method": "set_ui_options", "params": [{}] }' +ui_out '{ "jsonrpc": "2.0", "method": "draw", "params": [[[{ "face": { "fg": "black", "bg": "white", "attributes": ["final_fg","final_bg"] }, "contents": " " }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "/**\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " * ```shell\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " * $ cargo install\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " * ```\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " *\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " * " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "```edition2018" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "," }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "no_run" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " *" }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": " #" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "blue", "bg": "default", "attributes": [] }, "contents": "use" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " foo;\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " *" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "green", "bg": "default", "attributes": [] }, "contents": "foo" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "::" }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "bar" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "(" }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "\"Hello world\"" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": ");\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " *" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "```" }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " */" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "/**\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": " #" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "blue", "bg": "default", "attributes": [] }, "contents": "use" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " foo;\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "green", "bg": "default", "attributes": [] }, "contents": "foo" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "::" }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "bar" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "(" }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "\"Hello world\"" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": ");\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "```" }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " */" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }]], { "fg": "default", "bg": "default", "attributes": [] }, { "fg": "blue", "bg": "default", "attributes": [] }] }' +ui_out '{ "jsonrpc": "2.0", "method": "menu_hide", "params": [] }' +ui_out '{ "jsonrpc": "2.0", "method": "info_hide", "params": [] }' +ui_out '{ "jsonrpc": "2.0", "method": "draw_status", "params": [[], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "out 1:1 " }, { "face": { "fg": "black", "bg": "yellow", "attributes": [] }, "contents": "" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "blue", "bg": "default", "attributes": [] }, "contents": "1 sel" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " - client0@[kak-tests]" }], { "fg": "cyan", "bg": "default", "attributes": [] }] }' +ui_out '{ "jsonrpc": "2.0", "method": "set_cursor", "params": ["buffer", { "line": 0, "column": 0 }] }' +ui_out '{ "jsonrpc": "2.0", "method": "refresh", "params": [true] }' diff --git a/test/highlight/rust/inner_line_doc_comment1/cmd b/test/highlight/rust/inner_line_doc_comment1/cmd new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/test/highlight/rust/inner_line_doc_comment1/cmd @@ -0,0 +1 @@ + diff --git a/test/highlight/rust/inner_line_doc_comment1/in b/test/highlight/rust/inner_line_doc_comment1/in new file mode 100644 index 00000000..988cc706 --- /dev/null +++ b/test/highlight/rust/inner_line_doc_comment1/in @@ -0,0 +1,13 @@ + /// ```shell + /// $ cargo install + /// ``` + /// + /// ```edition2018,no_run + /// # use foo; + /// foo::bar("Hello world"); + /// ``` + /// + /// ``` + /// # use foo; + /// foo::bar("Hello world"); + /// ``` diff --git a/test/highlight/rust/inner_line_doc_comment1/rc b/test/highlight/rust/inner_line_doc_comment1/rc new file mode 100644 index 00000000..64064c25 --- /dev/null +++ b/test/highlight/rust/inner_line_doc_comment1/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/rust.kak" +set buffer filetype rust diff --git a/test/highlight/rust/inner_line_doc_comment1/script b/test/highlight/rust/inner_line_doc_comment1/script new file mode 100644 index 00000000..fc014de3 --- /dev/null +++ b/test/highlight/rust/inner_line_doc_comment1/script @@ -0,0 +1,7 @@ +ui_out '{ "jsonrpc": "2.0", "method": "set_ui_options", "params": [{}] }' +ui_out '{ "jsonrpc": "2.0", "method": "draw", "params": [[[{ "face": { "fg": "black", "bg": "white", "attributes": ["final_fg","final_bg"] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " /// ```shell\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " /// $ cargo install\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " /// ```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "///" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "///" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "```edition2018" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "," }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "no_run" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "///" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "#" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "blue", "bg": "default", "attributes": [] }, "contents": "use" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " foo;\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "///" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "green", "bg": "default", "attributes": [] }, "contents": "foo" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "::" }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "bar" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "(" }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "\"Hello world\"" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": ");\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "///" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "///" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "///" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "///" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "#" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "blue", "bg": "default", "attributes": [] }, "contents": "use" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " foo;\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "///" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "green", "bg": "default", "attributes": [] }, "contents": "foo" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "::" }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "bar" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "(" }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "\"Hello world\"" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": ");\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "///" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }]], { "fg": "default", "bg": "default", "attributes": [] }, { "fg": "blue", "bg": "default", "attributes": [] }] }' +ui_out '{ "jsonrpc": "2.0", "method": "menu_hide", "params": [] }' +ui_out '{ "jsonrpc": "2.0", "method": "info_hide", "params": [] }' +ui_out '{ "jsonrpc": "2.0", "method": "draw_status", "params": [[], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "out 1:1 " }, { "face": { "fg": "black", "bg": "yellow", "attributes": [] }, "contents": "" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "blue", "bg": "default", "attributes": [] }, "contents": "1 sel" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " - client0@[kak-tests]" }], { "fg": "cyan", "bg": "default", "attributes": [] }] }' +ui_out '{ "jsonrpc": "2.0", "method": "set_cursor", "params": ["buffer", { "line": 0, "column": 0 }] }' +ui_out '{ "jsonrpc": "2.0", "method": "refresh", "params": [true] }' diff --git a/test/highlight/rust/line_comment1/cmd b/test/highlight/rust/line_comment1/cmd new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/test/highlight/rust/line_comment1/cmd @@ -0,0 +1 @@ + diff --git a/test/highlight/rust/line_comment1/in b/test/highlight/rust/line_comment1/in new file mode 100644 index 00000000..97d87ced --- /dev/null +++ b/test/highlight/rust/line_comment1/in @@ -0,0 +1,11 @@ + //!! ``` + //!! foo::bar("Hello world"); + //!! ``` + + //// ``` + //// foo::bar("Hello world"); + //// ``` + + // ``` + // foo::bar("Hello world"); + // ``` diff --git a/test/highlight/rust/line_comment1/rc b/test/highlight/rust/line_comment1/rc new file mode 100644 index 00000000..64064c25 --- /dev/null +++ b/test/highlight/rust/line_comment1/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/rust.kak" +set buffer filetype rust diff --git a/test/highlight/rust/line_comment1/script b/test/highlight/rust/line_comment1/script new file mode 100644 index 00000000..0eb3f2f4 --- /dev/null +++ b/test/highlight/rust/line_comment1/script @@ -0,0 +1,7 @@ +ui_out '{ "jsonrpc": "2.0", "method": "set_ui_options", "params": [{}] }' +ui_out '{ "jsonrpc": "2.0", "method": "draw", "params": [[[{ "face": { "fg": "black", "bg": "white", "attributes": ["final_fg","final_bg"] }, "contents": " " }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//!! ```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//!! foo::bar(\"Hello world\");" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//!! ```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//// ```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//// foo::bar(\"Hello world\");" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//// ```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "// ```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "// foo::bar(\"Hello world\");" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "// ```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }]], { "fg": "default", "bg": "default", "attributes": [] }, { "fg": "blue", "bg": "default", "attributes": [] }] }' +ui_out '{ "jsonrpc": "2.0", "method": "menu_hide", "params": [] }' +ui_out '{ "jsonrpc": "2.0", "method": "info_hide", "params": [] }' +ui_out '{ "jsonrpc": "2.0", "method": "draw_status", "params": [[], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "out 1:1 " }, { "face": { "fg": "black", "bg": "yellow", "attributes": [] }, "contents": "" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "blue", "bg": "default", "attributes": [] }, "contents": "1 sel" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " - client0@[kak-tests]" }], { "fg": "cyan", "bg": "default", "attributes": [] }] }' +ui_out '{ "jsonrpc": "2.0", "method": "set_cursor", "params": ["buffer", { "line": 0, "column": 0 }] }' +ui_out '{ "jsonrpc": "2.0", "method": "refresh", "params": [true] }' diff --git a/test/highlight/rust/outer_block_doc_comment0/cmd b/test/highlight/rust/outer_block_doc_comment0/cmd new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/test/highlight/rust/outer_block_doc_comment0/cmd @@ -0,0 +1 @@ + diff --git a/test/highlight/rust/outer_block_doc_comment0/in b/test/highlight/rust/outer_block_doc_comment0/in new file mode 100644 index 00000000..f17230bc --- /dev/null +++ b/test/highlight/rust/outer_block_doc_comment0/in @@ -0,0 +1,14 @@ +//! # Hello World +//! +//! ```shell +//! $ cargo install +//! ``` +//! +//! ``` +//! # use foo; +//! foo::bar("Hello world"); +//! ``` + +//!! ``` +//!! foo::bar("Hello world"); +//!! ``` diff --git a/test/highlight/rust/outer_block_doc_comment0/rc b/test/highlight/rust/outer_block_doc_comment0/rc new file mode 100644 index 00000000..64064c25 --- /dev/null +++ b/test/highlight/rust/outer_block_doc_comment0/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/rust.kak" +set buffer filetype rust diff --git a/test/highlight/rust/outer_block_doc_comment0/script b/test/highlight/rust/outer_block_doc_comment0/script new file mode 100644 index 00000000..7792c638 --- /dev/null +++ b/test/highlight/rust/outer_block_doc_comment0/script @@ -0,0 +1,7 @@ +ui_out '{ "jsonrpc": "2.0", "method": "set_ui_options", "params": [{}] }' +ui_out '{ "jsonrpc": "2.0", "method": "draw", "params": [[[{ "face": { "fg": "black", "bg": "white", "attributes": ["final_fg","final_bg"] }, "contents": "/" }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "/! # Hello World" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//!" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//! ```shell\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//! $ cargo install\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//! ```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//!" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//!" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//!" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "#" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "blue", "bg": "default", "attributes": [] }, "contents": "use" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " foo;\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//!" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "green", "bg": "default", "attributes": [] }, "contents": "foo" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "::" }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "bar" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "(" }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "\"Hello world\"" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": ");\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//!" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//!! ```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//!! foo::bar(\"Hello world\");" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "//!! ```" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }]], { "fg": "default", "bg": "default", "attributes": [] }, { "fg": "blue", "bg": "default", "attributes": [] }] }' +ui_out '{ "jsonrpc": "2.0", "method": "menu_hide", "params": [] }' +ui_out '{ "jsonrpc": "2.0", "method": "info_hide", "params": [] }' +ui_out '{ "jsonrpc": "2.0", "method": "draw_status", "params": [[], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "out 1:1 " }, { "face": { "fg": "black", "bg": "yellow", "attributes": [] }, "contents": "" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "blue", "bg": "default", "attributes": [] }, "contents": "1 sel" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " - client0@[kak-tests]" }], { "fg": "cyan", "bg": "default", "attributes": [] }] }' +ui_out '{ "jsonrpc": "2.0", "method": "set_cursor", "params": ["buffer", { "line": 0, "column": 0 }] }' +ui_out '{ "jsonrpc": "2.0", "method": "refresh", "params": [true] }' diff --git a/test/highlight/rust/value/cmd b/test/highlight/rust/value/cmd new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/test/highlight/rust/value/cmd @@ -0,0 +1 @@ + diff --git a/test/highlight/rust/value/in b/test/highlight/rust/value/in new file mode 100644 index 00000000..03c0d8f8 --- /dev/null +++ b/test/highlight/rust/value/in @@ -0,0 +1,2 @@ +b'\' b'\x00' b'0' b'a' b' ' b'!' b'\n' b'一' b'\u{12}' +'\x00' '0' 'a' ' ' '!' '\n' '\u{12}' '一' diff --git a/test/highlight/rust/value/rc b/test/highlight/rust/value/rc new file mode 100644 index 00000000..64064c25 --- /dev/null +++ b/test/highlight/rust/value/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/rust.kak" +set buffer filetype rust diff --git a/test/highlight/rust/value/script b/test/highlight/rust/value/script new file mode 100644 index 00000000..6276322f --- /dev/null +++ b/test/highlight/rust/value/script @@ -0,0 +1,7 @@ +ui_out '{ "jsonrpc": "2.0", "method": "set_ui_options", "params": [{}] }' +ui_out '{ "jsonrpc": "2.0", "method": "draw", "params": [[[{ "face": { "fg": "black", "bg": "white", "attributes": ["final_fg","final_bg"] }, "contents": "b" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "'\\' " }, { "face": { "fg": "yellow", "bg": "default", "attributes": [] }, "contents": "b'\\x00'" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "yellow", "bg": "default", "attributes": [] }, "contents": "b'0'" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "yellow", "bg": "default", "attributes": [] }, "contents": "b'a'" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "yellow", "bg": "default", "attributes": [] }, "contents": "b' '" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "yellow", "bg": "default", "attributes": [] }, "contents": "b'!'" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "yellow", "bg": "default", "attributes": [] }, "contents": "b'\\n'" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " b" }, { "face": { "fg": "green", "bg": "default", "attributes": [] }, "contents": "'一'" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " b" }, { "face": { "fg": "green", "bg": "default", "attributes": [] }, "contents": "'\\u{12}'" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "green", "bg": "default", "attributes": [] }, "contents": "'\\x00'" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "green", "bg": "default", "attributes": [] }, "contents": "'0'" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "green", "bg": "default", "attributes": [] }, "contents": "'a'" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "green", "bg": "default", "attributes": [] }, "contents": "' '" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "green", "bg": "default", "attributes": [] }, "contents": "'!'" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "green", "bg": "default", "attributes": [] }, "contents": "'\\n'" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "green", "bg": "default", "attributes": [] }, "contents": "'\\u{12}'" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "green", "bg": "default", "attributes": [] }, "contents": "'一'" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }]], { "fg": "default", "bg": "default", "attributes": [] }, { "fg": "blue", "bg": "default", "attributes": [] }] }' +ui_out '{ "jsonrpc": "2.0", "method": "menu_hide", "params": [] }' +ui_out '{ "jsonrpc": "2.0", "method": "info_hide", "params": [] }' +ui_out '{ "jsonrpc": "2.0", "method": "draw_status", "params": [[], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "out 1:1 " }, { "face": { "fg": "black", "bg": "yellow", "attributes": [] }, "contents": "" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "blue", "bg": "default", "attributes": [] }, "contents": "1 sel" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " - client0@[kak-tests]" }], { "fg": "cyan", "bg": "default", "attributes": [] }] }' +ui_out '{ "jsonrpc": "2.0", "method": "set_cursor", "params": ["buffer", { "line": 0, "column": 0 }] }' +ui_out '{ "jsonrpc": "2.0", "method": "refresh", "params": [true] }' diff --git a/test/indent/rust/comment/cmd b/test/indent/rust/block-comment-close/cmd similarity index 100% rename from test/indent/rust/comment/cmd rename to test/indent/rust/block-comment-close/cmd diff --git a/test/indent/rust/block-comment-close/in b/test/indent/rust/block-comment-close/in new file mode 100644 index 00000000..2553fd94 --- /dev/null +++ b/test/indent/rust/block-comment-close/in @@ -0,0 +1,6 @@ + /* foo + * %( ) + + /* foo + *%( ) + diff --git a/test/indent/rust/block-comment-close/out b/test/indent/rust/block-comment-close/out new file mode 100644 index 00000000..4cdd2f36 --- /dev/null +++ b/test/indent/rust/block-comment-close/out @@ -0,0 +1,8 @@ + /* foo + */ +bar + + /* foo + * + * bar + diff --git a/test/indent/rust/block-comment-close/rc b/test/indent/rust/block-comment-close/rc new file mode 100644 index 00000000..64064c25 --- /dev/null +++ b/test/indent/rust/block-comment-close/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/rust.kak" +set buffer filetype rust diff --git a/test/indent/rust/block-comment/cmd b/test/indent/rust/block-comment/cmd new file mode 100644 index 00000000..8682d51e --- /dev/null +++ b/test/indent/rust/block-comment/cmd @@ -0,0 +1 @@ +cbar diff --git a/test/indent/rust/block-comment/in b/test/indent/rust/block-comment/in new file mode 100644 index 00000000..c38e3e41 --- /dev/null +++ b/test/indent/rust/block-comment/in @@ -0,0 +1,12 @@ + /* foo%( ) + + /*! foo%( ) + + /*!! foo%( ) + + /** foo%( ) + + /*** foo%( ) + + println!("hello world"); /* foo%( ) + diff --git a/test/indent/rust/block-comment/out b/test/indent/rust/block-comment/out new file mode 100644 index 00000000..e6c24302 --- /dev/null +++ b/test/indent/rust/block-comment/out @@ -0,0 +1,18 @@ + /* foo + * bar + + /*! foo + * bar + + /*!! foo + * bar + + /** foo + * bar + + /*** foo + * bar + + println!("hello world"); /* foo + bar + diff --git a/test/indent/rust/block-comment/rc b/test/indent/rust/block-comment/rc new file mode 100644 index 00000000..64064c25 --- /dev/null +++ b/test/indent/rust/block-comment/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/rust.kak" +set buffer filetype rust diff --git a/test/indent/rust/line-comment-close/cmd b/test/indent/rust/line-comment-close/cmd new file mode 100644 index 00000000..8682d51e --- /dev/null +++ b/test/indent/rust/line-comment-close/cmd @@ -0,0 +1 @@ +cbar diff --git a/test/indent/rust/line-comment-close/in b/test/indent/rust/line-comment-close/in new file mode 100644 index 00000000..6832ae64 --- /dev/null +++ b/test/indent/rust/line-comment-close/in @@ -0,0 +1,26 @@ + // foo + // %( ) + + // foo + //%( ) + + //! %( ) + + //!%( ) + + //!! %( ) + + //!!%( ) + + /// %( ) + + ///%( ) + + //// %( ) + + ////%( ) + + println!("hello world"); // %( ) + + println!("hello world"); //%( ) + diff --git a/test/indent/rust/line-comment-close/out b/test/indent/rust/line-comment-close/out new file mode 100644 index 00000000..dc8f04e4 --- /dev/null +++ b/test/indent/rust/line-comment-close/out @@ -0,0 +1,33 @@ + // foo + // + // bar + + // foo + bar + + //! + //! bar + + bar + + //!! + //!! bar + + bar + + /// + /// bar + + bar + + //// + //// bar + + bar + + println!("hello world"); // + bar + + println!("hello world"); // + bar + diff --git a/test/indent/rust/line-comment-close/rc b/test/indent/rust/line-comment-close/rc new file mode 100644 index 00000000..64064c25 --- /dev/null +++ b/test/indent/rust/line-comment-close/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/rust.kak" +set buffer filetype rust diff --git a/test/indent/rust/line-comment/cmd b/test/indent/rust/line-comment/cmd new file mode 100644 index 00000000..8682d51e --- /dev/null +++ b/test/indent/rust/line-comment/cmd @@ -0,0 +1 @@ +cbar diff --git a/test/indent/rust/comment/in b/test/indent/rust/line-comment/in similarity index 100% rename from test/indent/rust/comment/in rename to test/indent/rust/line-comment/in diff --git a/test/indent/rust/comment/out b/test/indent/rust/line-comment/out similarity index 100% rename from test/indent/rust/comment/out rename to test/indent/rust/line-comment/out diff --git a/test/indent/rust/line-comment/rc b/test/indent/rust/line-comment/rc new file mode 100644 index 00000000..64064c25 --- /dev/null +++ b/test/indent/rust/line-comment/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/rust.kak" +set buffer filetype rust