[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/lua-mode e498788 142/468: lua-calculate-indentation: add c
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/lua-mode e498788 142/468: lua-calculate-indentation: add comments |
Date: |
Thu, 5 Aug 2021 04:58:24 -0400 (EDT) |
branch: elpa/lua-mode
commit e498788ffd1579ebe8c08762e108e7a07ff864bb
Author: immerrr <immerrr+lua@gmail.com>
Commit: immerrr <immerrr+lua@gmail.com>
lua-calculate-indentation: add comments
---
lua-mode.el | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/lua-mode.el b/lua-mode.el
index 2e2cbc1..540bd2b 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -985,8 +985,16 @@ to the left by the amount specified in lua-indent-level."
(indent-amt 0))
(save-excursion
(let ((continuing-p (lua-is-continuing-statement-p)))
- (or (lua-calculate-indentation-override)
- (when (lua-forward-line-skip-blanks 'back)
+ (or
+ ;; when calculating indentation, do the following:
+ ;; 1. check, if the line starts with indentation-modifier (open/close
brace)
+ ;; and if it should be indented/unindented in special way
+ (lua-calculate-indentation-override)
+
+ ;; 2. otherwise, use indentation modifiers from previous line + it's
own indentation
+ ;; 3. if previous line doesn't contain indentation modifiers,
additionally check
+ ;; if current line is a continuation line and add lua-indent-level
if it is
+ (when (lua-forward-line-skip-blanks 'back)
;; the order of function calls here is important. block modifier
;; call may change the point to another line
(let ((modifier
@@ -995,7 +1003,9 @@ to the left by the amount specified in lua-indent-level."
lua-indent-level
modifier)
(current-indentation))))
- 0)))))
+
+ ;; 4. if there's no previous line, indentation is 0
+ 0)))))
(defun lua-beginning-of-proc (&optional arg)
"Move backward to the beginning of a lua proc (or similar).
- [nongnu] elpa/lua-mode da22ef7 094/468: Rename lua-clear-multiline-delims -> lua-unmark-multiline-literals, (continued)
- [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
- [nongnu] elpa/lua-mode e498788 142/468: lua-calculate-indentation: add comments,
Philip Kaludercic <=
- [nongnu] elpa/lua-mode 1e61379 111/468: Fix most of compile-time warnings, add couple FIXMEs, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode d6232fe 119/468: lua-find-regexp: check if match-beginning should be ignored too, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode c23fb54 127/468: lua-automark: mark only those buffer parts that may have changed their syntactical meaning, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode dfdbd85 143/468: lua-cont-eol-regexp: add missing keywords "if", "until" and "elseif", Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 612b1e7 166/468: Fixed misplaced paranthesis., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 4a203b9 172/468: add lua-send-defun (a lua-send-proc replacement), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 58da3f9 066/468: Remove comment about setting lua-mode-map: not required anymore, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode e3a4390 092/468: lua-mark-all-multiline-literals: add default keybinding "lua-prefix C-; ", Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode fa1ef23 107/468: lua-mode-map: dont evaluate at compile-time (fix byte-compilation error), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode e9a17ba 120/468: Added autoload for (add-to-list 'interpreter-mode-alist '("lua" . lua-mode)), Philip Kaludercic, 2021/08/05