[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/scala-mode 4b492b9 179/217: Fix for fill-paragraph (#123)
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/scala-mode 4b492b9 179/217: Fix for fill-paragraph (#123) |
Date: |
Sun, 29 Aug 2021 11:31:08 -0400 (EDT) |
branch: elpa/scala-mode
commit 4b492b9fa5f97521426f50c8dcfb6c0a251840ea
Author: Nelson Loyola <nloyola@users.noreply.github.com>
Commit: Sam Halliday <sam.halliday@gmail.com>
Fix for fill-paragraph (#123)
Constant scala-paragraph:paragraph-separate-re cannot have the same
values as scala-paragraph:paragraph-start-re for fill-paragraph,
forward-paragraph and backward-paragraph to work.
---
scala-mode-paragraph.el | 37 +++++++++++++------------------------
1 file changed, 13 insertions(+), 24 deletions(-)
diff --git a/scala-mode-paragraph.el b/scala-mode-paragraph.el
index 73e4ec3..9713b2d 100644
--- a/scala-mode-paragraph.el
+++ b/scala-mode-paragraph.el
@@ -9,47 +9,36 @@
;;; multi-line strings.
(defconst scala-paragraph:paragraph-line-start-re
- (concat "\\(?:\\s *" ; whitespace
+ (concat "\\(?:\\s-*" ; whitespace
"\\(?://+\\|\\*\\|/\\*+" ; comment start
"\\||\\)?" ; multi-line margin |
- "\\s *\\)")) ; whitespace
+ "\\s-*\\)")) ; whitespace
(defconst scala-paragraph:scaladoc-list-start-re
(concat "\\(?:-" ; unordered liststs
"\\|[1IiAa]\\." ; ordered lists
- "\\)\\s *"))
+ "\\)\\s-*"))
(defconst scala-paragraph:fill-first-line-re
- (concat "\\s *\\(//+\\|\\*\\||\\)?\\s *"
+ (concat "\\s-*\\(//+\\|\\*\\||\\)?\\s-*"
"\\(?:" scala-paragraph:scaladoc-list-start-re "\\)?"))
(defconst scala-paragraph:paragraph-start-re
(concat scala-paragraph:paragraph-line-start-re
"\\(?:$" ; empty line
- "\\|=[^=\n]+=[ ]*$" ; heading 1
- "\\|==[^=\n]+==[ ]*$" ; heading 2
- "\\|===[^=\n]+===[ ]*$" ; heading 3
- "\\|====+[^=\n]+====+[ ]*$" ; heading 4-n
+ "\\|==*[^=]+==*[ ]*$" ; headings
"\\|"
scala-paragraph:scaladoc-list-start-re
- "\\|{{{" ; code block start
- "\\|}}}" ; code block end
+ "\\|{{{" ; code block start
+ "\\|}}}" ; code block end
"\\|@[a-zA-Z]+\\>" ; annotations
"\\)"
- "\\|\\(?:\\s *\\*/\\)" ; end of comment
+ "\\|\\(?:\\s-*\\*/\\)" ; end of comment
))
(defconst scala-paragraph:paragraph-separate-re
(concat scala-paragraph:paragraph-line-start-re
- "\\(?:$"
- "\\|=[^=\n]+=[ ]*$" ; heading 1
- "\\|==[^=\n]+==[ ]*$" ; heading 2
- "\\|===[^=\n]+===[ ]*$" ; heading 3
- "\\|====+[^=\n]+====+[ ]*$" ; heading 4-n
- "\\|@[a-zA-Z]+\\>" ; annotations
- "\\|{{{" ; code block start
- "\\|}}}" ; code block end
- "\\)"
+ "\\(?:$\\)"
"\\|\\(?:\\s *\\*/\\)" ; end of comment
))
@@ -59,7 +48,7 @@
(save-excursion
(widen)
(beginning-of-line)
- (cond ((looking-at "\\s */?\\*+\\s *")
+ (cond ((looking-at "\\s-*/?\\*+\\s-*")
(setq fill (replace-regexp-in-string
"/\\*+"
(lambda (str) (if (= (length str) 3) " *" " *"))
@@ -71,7 +60,7 @@
(match-beginning 0))
?\s)))))
((or (re-search-forward "\"\"\"|" (line-end-position) t)
(and (eq (nth 3 (syntax-ppss)) t)
- (re-search-forward "^\\s *|" (line-end-position) t)))
+ (re-search-forward "^\\s-*|" (line-end-position) t)))
(setq fill (concat (make-string (- (current-column) 1) ?\s)
"|"))
(setq fill (concat fill (make-string (skip-syntax-forward " ")
?\s)))
(when (looking-at scala-paragraph:scaladoc-list-start-re)
@@ -81,8 +70,8 @@
fill))
(defun scala-paragraph:fill-paragraph (&rest args)
- ;; move to inside multi-line comment or multi-line stirng, if outside
- (when (looking-at "\\s *\\(?:/\\**\\|\"\"\"\\)\\s *")
+ ;; move to inside multi-line comment or multi-line string, if outside
+ (when (looking-at "\\s-*\\(?:/\\**\\|\"\"\"\\)\\s-*")
(goto-char (match-end 0)))
(let ((state (syntax-ppss))
(fill-paragraph-function
- [nongnu] elpa/scala-mode 13b30a6 093/217: Added Hugh Giddens to contributors, (continued)
- [nongnu] elpa/scala-mode 13b30a6 093/217: Added Hugh Giddens to contributors, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 9ab0a59 091/217: Update README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode c48b479 113/217: Update README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode af2dc30 136/217: Removed Marmelade from README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 8d4d99b 156/217: Add optional flattening to creation of imenu index (again)., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode aebed53 168/217: Mark a couple of indentation variables as safe (#105), ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode ece95ca 170/217: use CI to compile PRs, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 37e7537 173/217: rename to scala-mode (#110), ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 474a616 175/217: Merge ob-scala into scala-mode (#107), ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode a0b73b2 177/217: add string interpolation (#116), ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 4b492b9 179/217: Fix for fill-paragraph (#123),
ELPA Syncer <=
- [nongnu] elpa/scala-mode 5ffaa1f 185/217: Merge pull request #129 from ensime/hvesalai-patch-94, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode f88091a 191/217: `**` at end of multiline comment cause issue #140 (#141), ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 44772cb 196/217: fixed some compilation warnings, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 9e5b8af 190/217: Operator characters ids cannot be adjoint to word constituent ids (#139), ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode a82f186 192/217: Removed duplicated defconst, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode cc960f3 197/217: fixed some markdown syntax mistakes, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 9d3b56e 206/217: Merge pull request #161 from Kazark/scala3-keywords, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode a4ed6b4 073/217: Merge pull request #28 from non/bug/fix-colon-operators, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 27459c3 080/217: Merge pull request #32 from evnm/insert-asterisk-in-multiline-comment, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode e0341e9 199/217: Recognize worksheets as scala files, ELPA Syncer, 2021/08/29