From 7e09e7fcd5002f9c513b213c7cddc20426a8ab82 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Tue, 2 Jun 2020 21:48:22 +0800 Subject: [PATCH 1/8] Update rust rc comment --- rc/filetype/rust.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/filetype/rust.kak b/rc/filetype/rust.kak index 24d36f88..96115418 100644 --- a/rc/filetype/rust.kak +++ b/rc/filetype/rust.kak @@ -127,7 +127,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*\{$ > _ ] From e14cc26f1bc035d71b851c2213a8457e9bd6f291 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Tue, 2 Jun 2020 21:49:22 +0800 Subject: [PATCH 2/8] Add default keyword for rust --- rc/filetype/rust.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/filetype/rust.kak b/rc/filetype/rust.kak index 96115418..b7e0e8f0 100644 --- a/rc/filetype/rust.kak +++ b/rc/filetype/rust.kak @@ -81,7 +81,7 @@ add-highlighter shared/rust/code/macro regex \b[A-z0-9_]+! 0:meta # the number literals syntax is defined here: # https://doc.rust-lang.org/reference/tokens.html#numbers add-highlighter shared/rust/code/values regex \b(?:self|true|false|[0-9][_0-9]*(?:\.[0-9][_0-9]*|(?:\.[0-9][_0-9]*)?E[\+\-][_0-9]+)(?:f(?:32|64))?|(?:0x[_0-9a-fA-F]+|0o[_0-7]+|0b[_01]+|[0-9][_0-9]*)(?:(?:i|u|f)(?:8|16|32|64|128|size))?)\b 0:value -add-highlighter shared/rust/code/attributes regex \b(?:trait|struct|enum|type|mut|ref|static|const|default)\b 0:attribute +add-highlighter shared/rust/code/attributes regex \b(?:trait|struct|enum|union|type|mut|ref|static|const|default)\b 0:attribute # the language keywords are defined here, but many of them are reserved and unused yet: # https://doc.rust-lang.org/reference/keywords.html add-highlighter shared/rust/code/keywords regex \b(?:let|as|fn|return|match|if|else|loop|for|in|while|break|continue|move|box|where|impl|dyn|pub|unsafe|async|await|mod|crate|use|extern)\b 0:keyword From eac59863231af50d65eaba60b6a1acef31635923 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Tue, 2 Jun 2020 22:03:37 +0800 Subject: [PATCH 3/8] Fix rust doctest non-hidden macro highlight --- rc/filetype/rust.kak | 3 +-- test/highlight/rust/comment/in | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/rc/filetype/rust.kak b/rc/filetype/rust.kak index b7e0e8f0..8a57ce9e 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 diff --git a/test/highlight/rust/comment/in b/test/highlight/rust/comment/in index 2ce32f0a..c4dd2113 100644 --- a/test/highlight/rust/comment/in +++ b/test/highlight/rust/comment/in @@ -86,3 +86,19 @@ fn bar(s: &str) { * ``` */ + //! ``` + //! // not hidden # + //! #![feature(x)] + //! # // hidden # + //! # #![feature(x)] + //! ``` + + /** + * ``` + * // not hidden # + * #![feature(x)] + * # // hidden # + * # #![feature(x)] + * ``` + */ + From 74e16a062394685e4569512c93f7b1a85a0efbf6 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Thu, 4 Jun 2020 01:11:10 +0800 Subject: [PATCH 4/8] Fix rust comment test --- test/highlight/rust/comment/script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/highlight/rust/comment/script b/test/highlight/rust/comment/script index 560e4d98..c86b0139 100644 --- a/test/highlight/rust/comment/script +++ b/test/highlight/rust/comment/script @@ -1,5 +1,5 @@ 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": "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" }], [{ "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": [] }] }' From 7bd459f7749ffc4513f22b8450a3f121d82e6103 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Fri, 5 Jun 2020 11:06:49 +0800 Subject: [PATCH 5/8] Fix rust comment end --- rc/filetype/rust.kak | 2 +- test/highlight/rust/comment/in | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/rc/filetype/rust.kak b/rc/filetype/rust.kak index 8a57ce9e..396557f7 100644 --- a/rc/filetype/rust.kak +++ b/rc/filetype/rust.kak @@ -39,7 +39,7 @@ 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*//[!/]( #(?= )|)' ' ' 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/code default-region ref rust diff --git a/test/highlight/rust/comment/in b/test/highlight/rust/comment/in index c4dd2113..65128cba 100644 --- a/test/highlight/rust/comment/in +++ b/test/highlight/rust/comment/in @@ -102,3 +102,16 @@ fn bar(s: &str) { * ``` */ + /// ``` + /// println!("empty line"); + /// + /// println!("continue line"); + /// ``` + + /** + * ``` + * println!("empty line"); + * + * println!("continue line"); + * ``` + */ From 21c38f37cd2cce51236724aeb7ff7b61182c1727 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Tue, 9 Jun 2020 14:02:51 +0800 Subject: [PATCH 6/8] Fix rust character highlight --- rc/filetype/rust.kak | 4 +++- test/highlight/rust/value/cmd | 1 + test/highlight/rust/value/in | 2 ++ test/highlight/rust/value/rc | 3 +++ test/highlight/rust/value/script | 7 +++++++ 5 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 test/highlight/rust/value/cmd create mode 100644 test/highlight/rust/value/in create mode 100644 test/highlight/rust/value/rc create mode 100644 test/highlight/rust/value/script diff --git a/rc/filetype/rust.kak b/rc/filetype/rust.kak index 396557f7..eac61115 100644 --- a/rc/filetype/rust.kak +++ b/rc/filetype/rust.kak @@ -67,7 +67,6 @@ add-highlighter shared/rust/macro_attributes/ default-region fill meta add-highlighter shared/rust/macro_attributes/string region %{(? Date: Sat, 20 Jun 2020 11:44:00 +0800 Subject: [PATCH 7/8] Split rust comment tests --- test/highlight/rust/comment/in | 117 ------------------ test/highlight/rust/{comment => comment0}/cmd | 0 test/highlight/rust/comment0/in | 8 ++ test/highlight/rust/{comment => comment0}/rc | 0 test/highlight/rust/comment0/script | 7 ++ test/highlight/rust/doc_comment_hidden/cmd | 1 + test/highlight/rust/doc_comment_hidden/in | 15 +++ test/highlight/rust/doc_comment_hidden/rc | 3 + test/highlight/rust/doc_comment_hidden/script | 7 ++ .../doc_comment_hidden_with_empty_line/cmd | 1 + .../doc_comment_hidden_with_empty_line/in | 13 ++ .../doc_comment_hidden_with_empty_line/rc | 3 + .../doc_comment_hidden_with_empty_line/script | 7 ++ test/highlight/rust/inner_block_comment1/cmd | 1 + test/highlight/rust/inner_block_comment1/in | 11 ++ test/highlight/rust/inner_block_comment1/rc | 3 + .../rust/inner_block_comment1/script | 7 ++ .../rust/inner_block_doc_comment1/cmd | 1 + .../rust/inner_block_doc_comment1/in | 17 +++ .../rust/inner_block_doc_comment1/rc | 3 + .../rust/inner_block_doc_comment1/script | 7 ++ .../rust/inner_line_doc_comment1/cmd | 1 + .../highlight/rust/inner_line_doc_comment1/in | 13 ++ .../highlight/rust/inner_line_doc_comment1/rc | 3 + .../rust/inner_line_doc_comment1/script | 7 ++ test/highlight/rust/line_comment1/cmd | 1 + test/highlight/rust/line_comment1/in | 11 ++ test/highlight/rust/line_comment1/rc | 3 + test/highlight/rust/line_comment1/script | 7 ++ .../rust/outer_block_doc_comment0/cmd | 1 + .../rust/outer_block_doc_comment0/in | 14 +++ .../rust/outer_block_doc_comment0/rc | 3 + .../script | 2 +- 33 files changed, 180 insertions(+), 118 deletions(-) delete mode 100644 test/highlight/rust/comment/in rename test/highlight/rust/{comment => comment0}/cmd (100%) create mode 100644 test/highlight/rust/comment0/in rename test/highlight/rust/{comment => comment0}/rc (100%) create mode 100644 test/highlight/rust/comment0/script create mode 100644 test/highlight/rust/doc_comment_hidden/cmd create mode 100644 test/highlight/rust/doc_comment_hidden/in create mode 100644 test/highlight/rust/doc_comment_hidden/rc create mode 100644 test/highlight/rust/doc_comment_hidden/script create mode 100644 test/highlight/rust/doc_comment_hidden_with_empty_line/cmd create mode 100644 test/highlight/rust/doc_comment_hidden_with_empty_line/in create mode 100644 test/highlight/rust/doc_comment_hidden_with_empty_line/rc create mode 100644 test/highlight/rust/doc_comment_hidden_with_empty_line/script create mode 100644 test/highlight/rust/inner_block_comment1/cmd create mode 100644 test/highlight/rust/inner_block_comment1/in create mode 100644 test/highlight/rust/inner_block_comment1/rc create mode 100644 test/highlight/rust/inner_block_comment1/script create mode 100644 test/highlight/rust/inner_block_doc_comment1/cmd create mode 100644 test/highlight/rust/inner_block_doc_comment1/in create mode 100644 test/highlight/rust/inner_block_doc_comment1/rc create mode 100644 test/highlight/rust/inner_block_doc_comment1/script create mode 100644 test/highlight/rust/inner_line_doc_comment1/cmd create mode 100644 test/highlight/rust/inner_line_doc_comment1/in create mode 100644 test/highlight/rust/inner_line_doc_comment1/rc create mode 100644 test/highlight/rust/inner_line_doc_comment1/script create mode 100644 test/highlight/rust/line_comment1/cmd create mode 100644 test/highlight/rust/line_comment1/in create mode 100644 test/highlight/rust/line_comment1/rc create mode 100644 test/highlight/rust/line_comment1/script create mode 100644 test/highlight/rust/outer_block_doc_comment0/cmd create mode 100644 test/highlight/rust/outer_block_doc_comment0/in create mode 100644 test/highlight/rust/outer_block_doc_comment0/rc rename test/highlight/rust/{comment => outer_block_doc_comment0}/script (72%) diff --git a/test/highlight/rust/comment/in b/test/highlight/rust/comment/in deleted file mode 100644 index 65128cba..00000000 --- a/test/highlight/rust/comment/in +++ /dev/null @@ -1,117 +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"); - * ``` - */ - - //! ``` - //! // not hidden # - //! #![feature(x)] - //! # // hidden # - //! # #![feature(x)] - //! ``` - - /** - * ``` - * // not hidden # - * #![feature(x)] - * # // hidden # - * # #![feature(x)] - * ``` - */ - - /// ``` - /// println!("empty line"); - /// - /// println!("continue line"); - /// ``` - - /** - * ``` - * println!("empty line"); - * - * println!("continue line"); - * ``` - */ 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/highlight/rust/doc_comment_hidden/rc b/test/highlight/rust/doc_comment_hidden/rc new file mode 100644 index 00000000..64064c25 --- /dev/null +++ b/test/highlight/rust/doc_comment_hidden/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/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/comment/script b/test/highlight/rust/outer_block_doc_comment0/script similarity index 72% rename from test/highlight/rust/comment/script rename to test/highlight/rust/outer_block_doc_comment0/script index c86b0139..7792c638 100644 --- a/test/highlight/rust/comment/script +++ b/test/highlight/rust/outer_block_doc_comment0/script @@ -1,5 +1,5 @@ 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" }], [{ "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": "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": [] }] }' From 974684aa684e9704b17a58fbb99c7c2803a261b4 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Thu, 9 Jul 2020 01:13:00 +0800 Subject: [PATCH 8/8] Improve rust comment closing handling /// foo ///%( ) /// foo /// %( ) With `cbar`, /// foo bar /// foo /// /// bar Based on c-family block comment handling, this patch also add rust block comment indentation. This affects `o` behavior on empty comment but it allows a way more efficient way to clear comments. --- rc/filetype/rust.kak | 47 ++++++++++++++++++- .../rust/{comment => block-comment-close}/cmd | 0 test/indent/rust/block-comment-close/in | 6 +++ test/indent/rust/block-comment-close/out | 8 ++++ .../rust/{comment => block-comment-close}/rc | 0 test/indent/rust/block-comment/cmd | 1 + test/indent/rust/block-comment/in | 12 +++++ test/indent/rust/block-comment/out | 18 +++++++ test/indent/rust/block-comment/rc | 3 ++ test/indent/rust/line-comment-close/cmd | 1 + test/indent/rust/line-comment-close/in | 26 ++++++++++ test/indent/rust/line-comment-close/out | 33 +++++++++++++ test/indent/rust/line-comment-close/rc | 3 ++ test/indent/rust/line-comment/cmd | 1 + test/indent/rust/{comment => line-comment}/in | 0 .../indent/rust/{comment => line-comment}/out | 0 test/indent/rust/line-comment/rc | 3 ++ 17 files changed, 160 insertions(+), 2 deletions(-) rename test/indent/rust/{comment => block-comment-close}/cmd (100%) create mode 100644 test/indent/rust/block-comment-close/in create mode 100644 test/indent/rust/block-comment-close/out rename test/indent/rust/{comment => block-comment-close}/rc (100%) create mode 100644 test/indent/rust/block-comment/cmd create mode 100644 test/indent/rust/block-comment/in create mode 100644 test/indent/rust/block-comment/out create mode 100644 test/indent/rust/block-comment/rc create mode 100644 test/indent/rust/line-comment-close/cmd create mode 100644 test/indent/rust/line-comment-close/in create mode 100644 test/indent/rust/line-comment-close/out create mode 100644 test/indent/rust/line-comment-close/rc create mode 100644 test/indent/rust/line-comment/cmd rename test/indent/rust/{comment => line-comment}/in (100%) rename test/indent/rust/{comment => line-comment}/out (100%) create mode 100644 test/indent/rust/line-comment/rc diff --git a/rc/filetype/rust.kak b/rc/filetype/rust.kak index eac61115..ecfee8ef 100644 --- a/rc/filetype/rust.kak +++ b/rc/filetype/rust.kak @@ -99,9 +99,52 @@ define-command -hidden rust-trim-indent %{ define-command -hidden rust-indent-on-new-line %~ evaluate-commands -draft -itersel %< - # copy // comments prefix and following white spaces try %{ - execute-keys -draft k 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 } 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/comment/rc b/test/indent/rust/block-comment-close/rc similarity index 100% rename from test/indent/rust/comment/rc rename to test/indent/rust/block-comment-close/rc 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