From: Eshel Yaron Date: Mon, 12 Sep 2022 07:58:15 +0000 (+0300) Subject: ADDED: (sweep-indent-line-ends-with-prefix-operator): New function X-Git-Tag: v0.2.1~5 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0b545cc1920332cf6ad31f49314eabf38e699e23;p=sweep.git ADDED: (sweep-indent-line-ends-with-prefix-operator): New function (sweep-indent-line-indentation): use it --- diff --git a/sweep.el b/sweep.el index 9141557..f3b1929 100644 --- a/sweep.el +++ b/sweep.el @@ -1110,7 +1110,7 @@ Interactively, a prefix arg means to prompt for BUFFER." ((sweep-indent-line-ends-with-else point)) ((sweep-indent-line-ends-with-arg point)) ((sweep-indent-line-ends-with-neck-p) 4) - ;; ((sweep-indent-line-ends-with-prefix-operator)) + ((sweep-indent-line-ends-with-prefix-operator)) (t (sweep-indent-line-fallback)))))) (defun sweep-indent-line-fallback () @@ -1120,6 +1120,15 @@ Interactively, a prefix arg means to prompt for BUFFER." (back-to-indentation) (current-column))) +(defun sweep-indent-line-ends-with-prefix-operator () + (save-excursion + (end-of-line) + (skip-syntax-backward " ") + (when-let ((symbol (symbol-at-point))) + (when (member (symbol-name symbol) (sweep-prefix-operators)) + (skip-syntax-backward "w_") + (+ (current-column) 4))))) + (defun sweep-indent-line-ends-with-if () (save-excursion (end-of-line)