From ee9c9a777cc850636282f0bca4bac4cb6f7ff557 Mon Sep 17 00:00:00 2001 From: Jason Felice Date: Wed, 15 May 2019 11:15:28 -0400 Subject: [PATCH] clojure: Fix indentation for lists with 1-character heads Indentation can be different depending on the first word of list forms. The indent hook uses `e` from inside the parent to select the first word for testing whether it is a special word; however, in the case of a one-character symbol, this selects to the end of the *next* word. This rejects such selections. --- rc/filetype/clojure.kak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc/filetype/clojure.kak b/rc/filetype/clojure.kak index e7852227..8f2cc488 100644 --- a/rc/filetype/clojure.kak +++ b/rc/filetype/clojure.kak @@ -199,11 +199,11 @@ define-command -hidden clojure-indent-on-new-line %{ try %{ # If a special form, indent another (indentwidth - 1) spaces - execute-keys -draft '"wze\A' %opt{clojure_special_indent_forms} '\z' + execute-keys -draft '"wze[\s()\[\]\{\}]\A' %opt{clojure_special_indent_forms} '\z' execute-keys -draft '"wzes.{' %sh{printf $(( kak_opt_indentwidth - 1 ))} '}\K.*;"i' } catch %{ # If not special and parameter appears on line 1, indent to parameter - execute-keys -draft '"wzes\h\K[^\s].*;"i' + execute-keys -draft '"wze[\s()\[\]\{\}]s\h\K[^\s].*;"i' } } try %{ execute-keys -draft '[rl"i' }