[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode 5bdf688 211/385: better in-line indentati
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode 5bdf688 211/385: better in-line indentation of parens |
Date: |
Tue, 5 Oct 2021 23:59:33 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit 5bdf688c7c751f8634bfca7c881197e3539159b7
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
better in-line indentation of parens
---
haskell-tng-smie.el | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/haskell-tng-smie.el b/haskell-tng-smie.el
index 43e8bfd..898f015 100644
--- a/haskell-tng-smie.el
+++ b/haskell-tng-smie.el
@@ -35,13 +35,16 @@
"A `newline-and-indent' with a better user experience for
`haskell-tng-mode'."
(interactive)
;; TODO a dynamically bound variable might improve the quality of
- ;; 'empty-line-token predictions.
+ ;; 'empty-line-token predictions. Parens are special-cased.
(when (<= (- (point-max) 1) (point))
;; WORKAROUND https://debbugs.gnu.org/cgi/bugreport.cgi?bug=36432
;; TODO fix the bug properly in SMIE
(save-excursion (insert "\n\n")))
- (let ((rem (when (/= (point) (line-end-position))
- (buffer-substring-no-properties (point) (line-end-position)))))
+ (let ((rem (save-excursion
+ (skip-syntax-forward " ")
+ (unless (looking-at (rx (syntax close-parenthesis)))
+ (when (/= (point) (line-end-position))
+ (buffer-substring-no-properties (point)
(line-end-position)))))))
(when rem
(delete-region (point) (line-end-position)))
;; TODO don't continue line comments if there is code before them
@@ -50,7 +53,6 @@
(call-interactively #'comment-indent-new-line)
(when rem
(save-excursion
- ;; TODO prune trailing whitespace
(insert rem)))))
;; TODO autodetection of indent options
- [nongnu] elpa/haskell-tng-mode b1122e4 188/385: allow users to use unsupported build tools, (continued)
- [nongnu] elpa/haskell-tng-mode b1122e4 188/385: allow users to use unsupported build tools, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode bd4ff6f 192/385: standardise on naming convention:, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3b5ac7f 190/385: package-lint, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode a227f7e 200/385: blank lines end a run of type definitions, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode e4ead98 201/385: thots on prettify-symbol, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 387aa18 203/385: more efficient layout algorithm, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode bfc3841 193/385: remove bind-key dependency, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 6acba95 206/385: better insertion indentation on toplevels, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 9bfc6bf 215/385: really basic imenu, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode f648cf9 212/385: fallback to current directory (e.g. for cabal scripts), ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 5bdf688 211/385: better in-line indentation of parens,
ELPA Syncer <=
- [nongnu] elpa/haskell-tng-mode 1cdf901 120/385: better escape syntax detection, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode c40c6e6 125/385: fix explicit export fontification bug, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 82312a2 126/385: working compilation matchers, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 794c80b 131/385: better indentation alts, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode d43fd73 141/385: more efficient indentation 'insert test, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode a830fcb 135/385: reindention test, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode aa2a0ad 146/385: prefer --enable-tests, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode a754020 144/385: indent alts will suggest based on previous <- lines, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 9023dc6 164/385: don't rely on line-based indentation rules, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode fdaaf38 148/385: indent after "in", ELPA Syncer, 2021/10/06