[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/sweeprolog c24190141d 5/7: ; Fix off-by-one in end of next
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/sweeprolog c24190141d 5/7: ; Fix off-by-one in end of next token position for parentheses |
Date: |
Wed, 27 Sep 2023 16:01:33 -0400 (EDT) |
branch: elpa/sweeprolog
commit c24190141da32abef40ab74ad8f3eaab26edf421
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>
; Fix off-by-one in end of next token position for parentheses
* sweeprolog.el (sweeprolog-next-token-boundaries): Return correct end
of token position for parentheses.
* sweeprolog-tests.el (up-list): New test.
---
sweeprolog-tests.el | 13 +++++++++++++
sweeprolog.el | 6 +++---
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/sweeprolog-tests.el b/sweeprolog-tests.el
index 09f711fb86..06f9ec24f3 100644
--- a/sweeprolog-tests.el
+++ b/sweeprolog-tests.el
@@ -1770,4 +1770,17 @@ f:o(Bar) --> baz(Bar)."
(forward-line)
(should (string= (add-log-current-defun) "f:o//1")))
+(sweeprolog-deftest up-list ()
+ "Test `up-list' support."
+ "
+foo((A,B)) =>
+ ( bar(-!-A)
+ ; baz(B)
+ ).
+"
+ (call-interactively #'up-list)
+ (should (= (point) 30))
+ (call-interactively #'up-list)
+ (should (= (point) 51)))
+
;;; sweeprolog-tests.el ends here
diff --git a/sweeprolog.el b/sweeprolog.el
index cfc524a517..a17253f538 100644
--- a/sweeprolog.el
+++ b/sweeprolog.el
@@ -4277,11 +4277,11 @@ work."
(forward-char -1))
(list 'operator beg (if (= beg (point)) end (point)))))
((= syn ?\()
- (list 'open beg (point)))
+ (list 'open beg (1+ beg)))
((= syn ?\))
- (list 'close beg (point)))
+ (list 'close beg (1+ beg)))
((= syn ?>) nil)
- (t (list 'else beg (point)))))))))
+ (t (list 'else beg (1+ beg)))))))))
(defun sweeprolog-last-token-boundaries (&optional pos)
(let ((point (or pos (point)))
- [nongnu] elpa/sweeprolog updated (dba83e95e6 -> 0dd67eba55), ELPA Syncer, 2023/09/27
- [nongnu] elpa/sweeprolog c03ac63bdb 1/7: ; (sweep_replace_update_state/7): Fix SSU guard classification, ELPA Syncer, 2023/09/27
- [nongnu] elpa/sweeprolog 659d6033f4 4/7: ; Avoid relying on 'diff-mode' faces, ELPA Syncer, 2023/09/27
- [nongnu] elpa/sweeprolog c3cccb68c9 6/7: ; Silence some byte-complier warnings, ELPA Syncer, 2023/09/27
- [nongnu] elpa/sweeprolog abdd68164a 2/7: ; (sweep_replace_term_r/12): Fix qualified head classification, ELPA Syncer, 2023/09/27
- [nongnu] elpa/sweeprolog c24190141d 5/7: ; Fix off-by-one in end of next token position for parentheses,
ELPA Syncer <=
- [nongnu] elpa/sweeprolog 0dd67eba55 7/7: ; Add missing ':type' for 'sweeprolog-top-level-use-pty', ELPA Syncer, 2023/09/27
- [nongnu] elpa/sweeprolog e02f243b03 3/7: ; Fix filtering of the just created body when extracting goal, ELPA Syncer, 2023/09/27