diff --git a/rc/filetype/rust.kak b/rc/filetype/rust.kak index f2fbfee1..51b5ef67 100644 --- a/rc/filetype/rust.kak +++ b/rc/filetype/rust.kak @@ -151,7 +151,7 @@ define-command -hidden rust-indent-on-new-line %~ # indent after lines ending with [{(].+ and move first parameter to own line try %< execute-keys -draft [c[({],[)}] \A[({][^\n]+\n[^\n]*\n?\z L i > # indent after non-empty lines not starting with operator and not ending with , or ; - # XXX s [^\h]* is workaround for broken negate match #3766, use this later + # XXX simplify this into a single without s try %< execute-keys -draft k s [^\h].+ \A[-+*/&|^})] [,](\h*/[/*].*|)$ j > # dedent after lines starting with . and ending with } or ) or , or ; try %_ execute-keys -draft k ^\h*\..*[}),]\h*$ j _ diff --git a/test/indent/rust/empty-line/cmd b/test/indent/rust/empty-line/cmd new file mode 100644 index 00000000..8682d51e --- /dev/null +++ b/test/indent/rust/empty-line/cmd @@ -0,0 +1 @@ +cbar diff --git a/test/indent/rust/empty-line/in b/test/indent/rust/empty-line/in new file mode 100644 index 00000000..e4ed2188 --- /dev/null +++ b/test/indent/rust/empty-line/in @@ -0,0 +1,2 @@ + %( ) + diff --git a/test/indent/rust/empty-line/out b/test/indent/rust/empty-line/out new file mode 100644 index 00000000..4567eae7 --- /dev/null +++ b/test/indent/rust/empty-line/out @@ -0,0 +1,3 @@ + + bar + diff --git a/test/indent/rust/empty-line/rc b/test/indent/rust/empty-line/rc new file mode 100644 index 00000000..64064c25 --- /dev/null +++ b/test/indent/rust/empty-line/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/rust.kak" +set buffer filetype rust