branch: externals/sql-indent
commit 4d9b8aa886010d6e80f0178857ed117a816e2435
Author: Alex Harsanyi <[email protected]>
Commit: Alex Harsanyi <[email protected]>
Use `indent-line-to` in `sqlind-indent-line`
---
sql-indent.el | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/sql-indent.el b/sql-indent.el
index 99d69c4..c21aa7e 100644
--- a/sql-indent.el
+++ b/sql-indent.el
@@ -1667,18 +1667,9 @@ syntaxes"
indentation unit and `sqlind-indentation-offsets-alist' is used to
determine how to indent each type of syntactic element."
(let* ((syntax (sqlind-syntax-of-line))
- (base-column (current-column))
- (indent-column (sqlind-calculate-indentation syntax)))
- (when indent-column
- (back-to-indentation)
- (let ((offset (- base-column (current-column))))
- ;; avoid modifying the buffer when the indentation does not
- ;; have to change
- (unless (eq (current-column) indent-column)
- (delete-horizontal-space)
- (indent-to indent-column))
- (when (> offset 0)
- (forward-char offset))))))
+ (column (sqlind-calculate-indentation syntax)))
+ (when column
+ (indent-line-to column))))
;;;; sqlind-setup