[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/scala-mode 6c4e8dc 128/217: Delete automatic space between
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/scala-mode 6c4e8dc 128/217: Delete automatic space between * and /. |
Date: |
Sun, 29 Aug 2021 11:30:57 -0400 (EDT) |
branch: elpa/scala-mode
commit 6c4e8dcae49a8ec9264eb49690d48881d8af3bc9
Author: Tillmann Rendel <rendel@informatik.uni-marburg.de>
Commit: Tillmann Rendel <rendel@informatik.uni-marburg.de>
Delete automatic space between * and /.
This allows to type */ to end a multi-line comment even if automatic
insertion of spaces after * is turned on. See issue #69.
Potential problem: What if the user actually wants to start a line
with / in a multi-line comment?
---
scala-mode2-indent.el | 12 ++++++++++++
scala-mode2-map.el | 4 +++-
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/scala-mode2-indent.el b/scala-mode2-indent.el
index 4c8441e..3475f51 100644
--- a/scala-mode2-indent.el
+++ b/scala-mode2-indent.el
@@ -880,6 +880,18 @@ the line."
(insert " "))
(scala-indent:indent-line-to (scala-indent:scaladoc-indent (nth 8
state))))))
+(defun scala-indent:fix-scaladoc-close ()
+ "This function is meant to be used with post-self-insert-hook.
+
+Changes 'asterisk space slash' to 'asterisk slash' in a
+multi-line comment if position is right after that slash and
+scala-indent:add-space-for-scaladoc-asterisk is t."
+ (let ((state (syntax-ppss)))
+ (when (and scala-indent:add-space-for-scaladoc-asterisk
+ (integerp (nth 4 state))
+ (looking-back "^\\s *\\*\\s /" (line-beginning-position)))
+ (delete-region (- (point) 2) (- (point) 1)))))
+
(defun scala-indent:insert-asterisk-on-multiline-comment ()
"Insert an asterisk at the end of the current line when at the beginning
of a line inside a multi-line comment "
diff --git a/scala-mode2-map.el b/scala-mode2-map.el
index 1f65080..78a847b 100644
--- a/scala-mode2-map.el
+++ b/scala-mode2-map.el
@@ -17,7 +17,9 @@
(add-hook 'post-self-insert-hook
'scala-indent:indent-on-special-words)
(add-hook 'post-self-insert-hook
- 'scala-indent:indent-on-scaladoc-asterisk))
+ 'scala-indent:indent-on-scaladoc-asterisk)
+ (add-hook 'post-self-insert-hook
+ 'scala-indent:fix-scaladoc-close))
(defun scala-mode-map:add-remove-indent-hook ()
(add-hook 'post-command-hook
- [nongnu] elpa/scala-mode a1ea0b7 097/217: Proper instructions and autoload settings for package-based install, (continued)
- [nongnu] elpa/scala-mode a1ea0b7 097/217: Proper instructions and autoload settings for package-based install, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 763c93c 107/217: scala-indent:join-line, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode c62ecf9 109/217: Update README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode aea047a 104/217: Create .gitignore with *.elc, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode d4cccb0 112/217: scala-mode:set-scala-syntax-mode to support sbt-mode, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode c9dd697 103/217: alphaid-re for SIP11 support, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 89c7138 102/217: Merge pull request #52 from non/topic/octal-escapes, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 600d27b 115/217: join-line cannot be re-defined like this, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 890b7eb 129/217: Document */ behavior in multi-line comments., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 3d330ad 126/217: Makefile clean-up 2, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 6c4e8dc 128/217: Delete automatic space between * and /.,
ELPA Syncer <=
- [nongnu] elpa/scala-mode 84ff656 138/217: Update README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode c90e085 131/217: Tweaked syntax rules to make highlighting more customizeable, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 68959cd 144/217: imenu is mostly working., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 1954eaa 146/217: move all stuff related to moving between defintions to bottom of scala-mode-syntax.el, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode e6a2755 147/217: Add stuff to readme. Small fixes. got rid fo whitespace changes., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 13c0f39 150/217: README changes., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode aaf1ed8 149/217: Readme update., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode b6f1300 152/217: undo some of the random changes., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode e18c50e 158/217: add cleanup hooks., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode c20d6e6 164/217: Merge pull request #101 from fommil/remove-post-insert-hook, ELPA Syncer, 2021/08/29