[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/lua-mode 96658a0 089/468: Move actual marking of multiline
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/lua-mode 96658a0 089/468: Move actual marking of multiline construct into lua-mark-multiline-region |
Date: |
Thu, 5 Aug 2021 04:58:13 -0400 (EDT) |
branch: elpa/lua-mode
commit 96658a0599e37052a21da62a55a2a19c126e8f15
Author: immerrr <immerrr@gmail.com>
Commit: immerrr <immerrr@gmail.com>
Move actual marking of multiline construct into lua-mark-multiline-region
---
lua-mode.el | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/lua-mode.el b/lua-mode.el
index 7ac76e0..ff335fc 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -1201,6 +1201,12 @@ If END is nil, stop at `end-of-buffer'."
(set-buffer-modified-p old-modified-p)))
(font-lock-fontify-buffer))
+(defun lua-mark-multiline-region (begin end)
+ (let ((type (if (eq ?- (char-after begin)) 'comment 'string)))
+ (lua-mark-char-multiline-delim begin type)
+ (when end
+ (lua-mark-char-multiline-delim (1- end) type))))
+
(defun lua-mark-all-multiline-literals (&optional begin end)
"Marks all Lua multiline constructs in region
@@ -1235,12 +1241,12 @@ If END is nil, stop at `end-of-buffer'."
;;
;; PS. ping me if you find a situation in which this is not true
(unless (lua-comment-or-string-p (1+ (match-beginning 0)))
- (let ((type (if (match-beginning 2) 'comment 'string)))
- (message "found %s" (match-string 0))
- (lua-mark-char-multiline-delim (match-beginning 0) type)
+ (let (ml-begin ml-end)
+ (setq ml-begin (match-beginning 0))
(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)))))))
+ (setq ml-end (match-end 0)))
+ (lua-mark-multiline-region ml-begin ml-end))))))
(provide 'lua-mode)
- [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), (continued)
- [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, 2021/08/05
- [nongnu] elpa/lua-mode 96658a0 089/468: Move actual marking of multiline construct into lua-mark-multiline-region,
Philip Kaludercic <=
- [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
- [nongnu] elpa/lua-mode 5a81583 140/468: Restore compatibility with Emacs22 and earlier that was broken when patching lua-mode-abbrev-table (should fix #11), Philip Kaludercic, 2021/08/05