[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/lua-mode 742180e 125/468: lua-automark-multiline: add lua-
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/lua-mode 742180e 125/468: lua-automark-multiline: add lua-automark-multiline-maxsize variable to prevent long waits on big files |
Date: |
Thu, 5 Aug 2021 04:58:20 -0400 (EDT) |
branch: elpa/lua-mode
commit 742180e151cc2e5c331cd204ee70cb417d87ac6b
Author: immerrr <immerrr+lua@gmail.com>
Commit: immerrr <immerrr+lua@gmail.com>
lua-automark-multiline: add lua-automark-multiline-maxsize variable to
prevent long waits on big files
---
lua-mode.el | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/lua-mode.el b/lua-mode.el
index a7cc482..9a3f5ad 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -1289,7 +1289,7 @@ If END is nil, stop at `end-of-buffer'."
(add-hook 'change-major-mode-hook 'lua--automark-multiline-cleanup nil
'local)
(setq lua-automark-multiline-timer
(run-with-idle-timer lua-automark-multiline-interval 'repeat
- 'lua-mark-all-multiline-literals))))
+ 'lua--automark-multiline-run))))
(defun lua--automark-multiline-cleanup ()
"Disable automatical multiline construct marking"
@@ -1297,6 +1297,10 @@ If END is nil, stop at `end-of-buffer'."
(cancel-timer lua-automark-multiline-timer)
(setq lua-automark-multiline-timer nil)))
+(defun lua--automark-multiline-run ()
+ (when (<= (buffer-size) lua-automark-multiline-maxsize)
+ (lua-mark-all-multiline-literals)))
+
(defun lua--customize-set-automark-multiline-interval (symbol value)
(set symbol value)
(dolist (buf (buffer-list))
@@ -1310,6 +1314,11 @@ If END is nil, stop at `end-of-buffer'."
:type 'integer
:set 'lua--customize-set-automark-multiline-interval)
+(defcustom lua-automark-multiline-maxsize 100000
+ "Maximum buffer size for which lua-mode will mark multiline literals
automatically."
+ :group 'lua
+ :type 'integer)
+
(provide 'lua-mode)
;;; lua-mode.el ends here
- [nongnu] elpa/lua-mode 8165775 069/468: Fix lua-set-prefix message, (continued)
- [nongnu] elpa/lua-mode 8165775 069/468: Fix lua-set-prefix message, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 6b1d389 074/468: lua-calculate-unindentation: skip semicolons as well, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode bda4fbd 075/468: lua-calculate-unindentation: update docs, remove extraneous catch, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode a20b08e 078/468: lua-indent-line: remove extra variable shift-amt, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode c0d6f80 079/468: Add markdown README, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 08cff6e 081/468: Implement basic multiline-aware functionality, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode dfc3b78 083/468: Preserve buffer-modified-p state when (un-)marking multiline delimiters, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 7920d17 087/468: lua-mark-all-multiline-literals: if region is active, limit to region boundaries, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 4a22b3c 100/468: Allow lua-start-process to be called interactively., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode a3ed448 106/468: Make dist with git-archive, Philip Kaludercic, 2021/08/05
- [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 <=
- [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