From 909eab5ee9dd2c7564f70015d4bc20c084410c60 Mon Sep 17 00:00:00 2001 From: "Andy K. Massimino" Date: Sun, 12 Sep 2021 09:26:19 -0400 Subject: [PATCH] Add starter TS queries for rust re #140 --- after/ftplugin/xml_matchup.vim | 3 ++- after/queries/rust/matchup.scm | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 after/queries/rust/matchup.scm diff --git a/after/ftplugin/xml_matchup.vim b/after/ftplugin/xml_matchup.vim index 55d4516..301a76c 100644 --- a/after/ftplugin/xml_matchup.vim +++ b/after/ftplugin/xml_matchup.vim @@ -18,7 +18,8 @@ if matchup#util#matchpref('tagnameonly', 0) call matchup#util#patch_match_words(':/>', ':/\g{hlend}>') endif +call matchup#util#patch_match_words('[^/>]*', '[^>]*[^/>]') + let &cpo = s:save_cpo " vim: fdm=marker sw=2 - diff --git a/after/queries/rust/matchup.scm b/after/queries/rust/matchup.scm new file mode 100644 index 0000000..b2d906f --- /dev/null +++ b/after/queries/rust/matchup.scm @@ -0,0 +1,7 @@ +(block (if_expression "if" @open.if_) @scope.if_) +(let_declaration (if_expression "if" @open.if_) @scope.if_) + +(else_clause "else" @mid.if_.1 (block)) +(else_clause + "else" @_start (if_expression "if" @_end) + (#make-range! "mid.if_.2" @_start @_end))