[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/go-mode 54a102e 046/495: do not move cursor to beginning o
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/go-mode 54a102e 046/495: do not move cursor to beginning of line after indentation |
Date: |
Sat, 7 Aug 2021 09:04:41 -0400 (EDT) |
branch: elpa/go-mode
commit 54a102e0dc6f286ded0da185490b271ebd014d3e
Author: Dominik Honnef <dominikh@fork-bomb.org>
Commit: Dominik Honnef <dominikh@fork-bomb.org>
do not move cursor to beginning of line after indentation
---
go-mode.el | 48 ++++++++++++++++++++++++------------------------
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/go-mode.el b/go-mode.el
index 8739d28..6dafcc0 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -196,30 +196,30 @@ built-ins, functions, and some types.")
(defun go-mode-indent-line ()
(interactive)
- (beginning-of-line)
- (if (not (go-in-comment-p))
- (let ((indent (go-indentation-at-point (point)))
- shift-amt
- end
- (pos (- (point-max) (point)))
- (beg (progn (beginning-of-line) (point))))
- (back-to-indentation)
- (if (looking-at "case .+:\\|default:")
- (setq indent (- indent tab-width)))
- (beginning-of-line)
- (if (and (looking-at
"^[[:space:]]*[[:word:]]+:\\([[:space:]]*/.+\\)?$")
- (not (looking-at "^[[:space:]]*default:")))
- (setq indent 0))
- (skip-chars-forward " \t")
- (setq shift-amt (- indent (current-column)))
- (if (zerop shift-amt)
- nil
- (delete-region beg (point))
- (indent-to indent))
- ;; If initial point was within line's indentation,
- ;; position after the indentation. Else stay at same point in text.
- (if (> (- (point-max) pos) (point))
- (goto-char (- (point-max) pos))))))
+ (let ((indent (go-indentation-at-point (point)))
+ shift-amt
+ end
+ (pos (- (point-max) (point)))
+ (beg (progn (beginning-of-line) (point))))
+ (back-to-indentation)
+ (if (go-in-comment-p) ;; Do not change the indentation of multi-line
comments
+ nil
+ (if (looking-at "case .+:\\|default:")
+ (setq indent (- indent tab-width)))
+ (beginning-of-line)
+ (if (and (looking-at "^[[:space:]]*[[:word:]]+:\\([[:space:]]*/.+\\)?$")
+ (not (looking-at "^[[:space:]]*default:")))
+ (setq indent 0))
+ (skip-chars-forward " \t")
+ (setq shift-amt (- indent (current-column)))
+ (if (zerop shift-amt)
+ nil
+ (delete-region beg (point))
+ (indent-to indent))
+ ;; If initial point was within line's indentation,
+ ;; position after the indentation. Else stay at same point in text.
+ (if (> (- (point-max) pos) (point))
+ (goto-char (- (point-max) pos))))))
(defun go-beginning-of-defun (&optional count)
(unless count (setq count 1))
- [nongnu] elpa/go-mode 426d2df 050/495: Improve indentation speed by not trying to indent unnested lines, (continued)
- [nongnu] elpa/go-mode 426d2df 050/495: Improve indentation speed by not trying to indent unnested lines, ELPA Syncer, 2021/08/07
- [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 <=
- [nongnu] elpa/go-mode 1128e71 052/495: do not try to turn off flymake if flymake isn't loaded, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 903768b 053/495: tweak godoc to behave more like help in emacs, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode e78baea 054/495: do not leave point at beginning of line when (not) indenting a comment, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode a5164ac 055/495: Fix indentation for code after multi-line function signature, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 72cf126 056/495: fix indentation for multi-line if expressions, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode cfc3d50 058/495: add more test cases, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 63929d2 085/495: get rid of go--flatten, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 850986e 022/495: Do not loop forever in go-beginning-of-defun if point is in comment and there's no function definition before point, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode b91c53e 025/495: save buffer before trying to remove unused imports, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 4371669 029/495: Merge branch 'feature/remove_unused_imports', ELPA Syncer, 2021/08/07