[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/go-mode 426d2df 050/495: Improve indentation speed by not
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/go-mode 426d2df 050/495: Improve indentation speed by not trying to indent unnested lines |
Date: |
Sat, 7 Aug 2021 09:04:41 -0400 (EDT) |
branch: elpa/go-mode
commit 426d2df753820ba8033e3c9ea6f8235418986a28
Author: Dominik Honnef <dominikh@fork-bomb.org>
Commit: Dominik Honnef <dominikh@fork-bomb.org>
Improve indentation speed by not trying to indent unnested lines
If a line has a nesting of zero, there's no way it could be indented at any
level other than zero
---
go-mode.el | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/go-mode.el b/go-mode.el
index 777ccc4..6075bb4 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -175,18 +175,20 @@ built-ins, functions, and some types.")
(+ (current-indentation) tab-width))
(go--backward-irrelevant)
(setq line-begin (line-beginning-position))
- (while (and
- (not (bobp))
- (>= (go-paren-level) start-nesting))
- (if (= 0 (skip-chars-backward "^[]{}()"))
- (backward-char))
- (if (go-in-string-p)
- (progn
- (go--backward-irrelevant)
- (setq line-begin (line-beginning-position)))))
- (if (and (< (go-paren-level) start-nesting))
- (+ (current-indentation) tab-width (- outindent))
- (- (current-indentation) outindent))))))))
+ (if (= (go-paren-level) 0)
+ 0
+ (while (and
+ (not (bobp))
+ (>= (go-paren-level) start-nesting))
+ (if (= 0 (skip-chars-backward "^[]{}()"))
+ (backward-char))
+ (if (go-in-string-p)
+ (progn
+ (go--backward-irrelevant)
+ (setq line-begin (line-beginning-position)))))
+ (if (and (< (go-paren-level) start-nesting))
+ (+ (current-indentation) tab-width (- outindent))
+ (- (current-indentation) outindent)))))))))
(defun go-mode-indent-line ()
(interactive)
- [nongnu] elpa/go-mode 55def23 008/495: more descriptive messages in go-goto-imports, (continued)
- [nongnu] elpa/go-mode 55def23 008/495: more descriptive messages in go-goto-imports, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode ccd95ee 016/495: rename some internal functions, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 5c8a47c 030/495: use (forward-line -1) instead of (previous-line), ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 4c5493b 036/495: also load diff-mode during compilation, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode faafd90 038/495: add autoload cookies, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode c97dacc 044/495: do not change the indentation of multiline comments, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 5fbf6bd 048/495: remove unnecessary progns, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 8065408 051/495: formatting, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode c14eb13 061/495: more test cases, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 5dc94e8 069/495: Remove enclosing quotes in go-import-add, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 426d2df 050/495: Improve indentation speed by not trying to indent unnested lines,
ELPA Syncer <=
- [nongnu] elpa/go-mode d10c4bc 020/495: use /= instead of (not (=)), ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 37181ae 021/495: add feature for removing unused imports, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode cf557a3 024/495: Merge branch 'fix/gh-2', ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 4372f5d 026/495: teach go-import-add how to uncomment imports, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 22427ec 028/495: update documentation, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode cf14ed3 033/495: comment unused function go--common-prefix, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 8e413db 035/495: require diff-mode during compilation, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 572c754 042/495: For continuation lines, do not assume the indentation of a multiline raw string, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 087f58f 043/495: don't expect a line end after labels or cases, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 54a102e 046/495: do not move cursor to beginning of line after indentation, ELPA Syncer, 2021/08/07