[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/lua-mode c5f37b0 088/468: lua-mark-all-multiline-literals:
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/lua-mode c5f37b0 088/468: lua-mark-all-multiline-literals: look for multiline ending beyond specified bounds to improve integrity |
Date: |
Thu, 5 Aug 2021 04:58:13 -0400 (EDT) |
branch: elpa/lua-mode
commit c5f37b0d7b4fa083258ac8d44d8d45e4559861b3
Author: immerrr <immerrr@gmail.com>
Commit: immerrr <immerrr@gmail.com>
lua-mark-all-multiline-literals: look for multiline ending beyond specified
bounds to improve integrity
---
lua-mode.el | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/lua-mode.el b/lua-mode.el
index deaf26b..7ac76e0 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -1215,11 +1215,16 @@ If END is nil, stop at `end-of-buffer'."
(lua-clear-multiline-delims begin end)
(save-excursion
(goto-char (or begin 1))
- ;; look for
- ;; 1. (optional) two or more dashes followed by
- ;; 2. lua multiline delimiter [[
- (while (re-search-forward "\\(?2:--\\)?\\[\\(?1:=*\\)\\[" end 'noerror)
+ (while (and
+ ;; must check for point range, because matching previous
+ ;; multiline end might move point beyond end and this
+ ;; drives `re-search-forward' crazy
+ (if end (< (point) end) t)
+ ;; look for
+ ;; 1. (optional) two or more dashes followed by
+ ;; 2. lua multiline delimiter [[
+ (re-search-forward "\\(?2:--\\)?\\[\\(?1:=*\\)\\[" end 'noerror))
;; match-start + 1 is considered instead of match-start, because
;; such approach handles '---[[' situation correctly: Emacs
;; thinks 2nd dash (i.e. match-start) is not yet a comment, but
@@ -1233,7 +1238,7 @@ If END is nil, stop at `end-of-buffer'."
(let ((type (if (match-beginning 2) 'comment 'string)))
(message "found %s" (match-string 0))
(lua-mark-char-multiline-delim (match-beginning 0) type)
- (when (re-search-forward (format "\\]%s\\]" (or (match-string 1)
"")) end 'noerror)
+ (when (re-search-forward (format "\\]%s\\]" (or (match-string 1)
"")) nil 'noerror)
(message "found match %s" (match-string 0))
(lua-mark-char-multiline-delim (1- (match-end 0)) type)))))))
- [nongnu] elpa/lua-mode 742180e 125/468: lua-automark-multiline: add lua-automark-multiline-maxsize variable to prevent long waits on big files, (continued)
- [nongnu] elpa/lua-mode 742180e 125/468: lua-automark-multiline: add lua-automark-multiline-maxsize variable to prevent long waits on big files, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 0b3df35 135/468: Fix string content indentation: it's now indented by indent-level relative to indentation of the line where string/comment literal starts (issue #6), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 5aa6f9e 042/468: Patch from Reuben: fix long string colouring problem, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode eb5d301 055/468: Bump version., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode d66ec8e 080/468: Remove broken multiline literal font-locking, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode d142ed1 084/468: Update TODO, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode de12f4b 086/468: lua-mark-all-multiline-literals: also handle multiline comments, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 46683e7 052/468: Make lua-indent-level customizable., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 3c89a0a 054/468: Reorder customizations better., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 158f267 058/468: Merge lua-goto-nonblank-* funcs into one, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode c5f37b0 088/468: lua-mark-all-multiline-literals: look for multiline ending beyond specified bounds to improve integrity,
Philip Kaludercic <=
- [nongnu] elpa/lua-mode 96658a0 089/468: Move actual marking of multiline construct into lua-mark-multiline-region, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode da22ef7 094/468: Rename lua-clear-multiline-delims -> lua-unmark-multiline-literals, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 5607327 096/468: Update TODO, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 2b91610 098/468: Bump contact information, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 5953970 101/468: Bump version, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode c044a1b 109/468: Fix emacs compilation warning in XEmacs-oriented code, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 3367502 121/468: Merge pull request #7 from rlph/master, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 9645322 124/468: lua-indent-line: add lua-indent-string-contents custom variable to enable indenting multiline strings if necessary (issue #6), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 99ef499 129/468: Make lua-automark variables buffer local, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 2ce253c 133/468: lua-automark: fix multiline comments recognition which was failing when there was a single-line comment previously, Philip Kaludercic, 2021/08/05