From 0b545cc1920332cf6ad31f49314eabf38e699e23 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Mon, 12 Sep 2022 10:58:15 +0300 Subject: [PATCH] ADDED: (sweep-indent-line-ends-with-prefix-operator): New function (sweep-indent-line-indentation): use it --- sweep.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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) -- 2.39.2