[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/scala-mode c3ea76f 009/217: fixed indenting of if body (an
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/scala-mode c3ea76f 009/217: fixed indenting of if body (and probably other things) |
Date: |
Sun, 29 Aug 2021 11:30:34 -0400 (EDT) |
branch: elpa/scala-mode
commit c3ea76fbd5bd4f27a49b3584803276c260bdf561
Author: Heikki Vesalainen <heikkivesalainen@yahoo.com>
Commit: Heikki Vesalainen <heikkivesalainen@yahoo.com>
fixed indenting of if body (and probably other things)
closes #1
---
scala-mode-syntax.el | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/scala-mode-syntax.el b/scala-mode-syntax.el
index eed7fc3..1313f7b 100644
--- a/scala-mode-syntax.el
+++ b/scala-mode-syntax.el
@@ -613,15 +613,18 @@ and whitespace are skipped before matching."
(scala-syntax:skip-forward-ignorable)
(looking-at re)))
-(defun scala-syntax:looking-back-token (re &optional limit)
+(defun scala-syntax:looking-back-token (re &optional max-chars)
"Return the start position of the token matched by re, if the
current position is preceeded by it, or nil if not. All ignorable
comments and whitespace are ignored, i.e. does not search past an
-empty line. Expects to be outside of comment."
+empty line. Expects to be outside of comment. A limit for the
+search is calculated based on max-chars. The function won't look
+further than max-chars starting after skipping any ignorable."
(save-excursion
;; skip back all comments
(scala-syntax:skip-backward-ignorable)
- (let ((end (point)))
+ (let ((end (point))
+ (limit (when max-chars (- (point) max-chars))))
;; skip back punctuation or ids (words and related symbols and
delimiters)
(or (/= 0 (skip-chars-backward scala-syntax:delimiter-group limit))
(/= 0 (skip-syntax-backward "." limit))
- [nongnu] elpa/scala-mode 5ba0a78 005/217: run-on and list indent primitives, (continued)
- [nongnu] elpa/scala-mode 5ba0a78 005/217: run-on and list indent primitives, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode ca7308a 002/217: Initial commit with README and Example.scala outlining how it will work, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode a8b0936 003/217: Working on syntax, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 6f1b748 001/217: Example.scala to show how we intend to indent, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 3413883 004/217: run-on-p, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode f0cc3d4 006/217: working on indent rules, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode f17fa95 007/217: approaching a functioning indent engine, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 4dbaa5f 010/217: picked some of Erik's fontlock magic for an interim solution, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 84e5c8a 013/217: regression fix, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode aebc5b0 017/217: Fixes #7: indenting of block lines when at last char of buffer, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode c3ea76f 009/217: fixed indenting of if body (and probably other things),
ELPA Syncer <=
- [nongnu] elpa/scala-mode ba3c9ca 020/217: renamed README to README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 9f74c7d 015/217: Partial fix to #5., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 84d9c10 011/217: highlight string escapes, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 150e3d2 012/217: updated README with some TODOs, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 64c496a 016/217: Fixed #4: numbers in ids, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 6bc98fd 024/217: Update README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode b0c821d 023/217: Working on README, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 7faea31 027/217: also handle .sbt files, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 0930f14 026/217: Update README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 2527376 032/217: Merge pull request #12 from non/topic/optional-padding, ELPA Syncer, 2021/08/29