[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/idris-mode 1382948269 01/14: Consider - as operator in idr
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/idris-mode 1382948269 01/14: Consider - as operator in idris-thing-at-point |
Date: |
Thu, 1 Dec 2022 08:02:53 -0500 (EST) |
branch: elpa/idris-mode
commit 1382948269f59188c5f5a76d2480124ad06d5947
Author: Marek L <nospam.keram@gmail.com>
Commit: Marek L <nospam.keram@gmail.com>
Consider - as operator in idris-thing-at-point
Why:
The `-` char is defined in idris-syntax-table as being
beginning of comment and causing condition:
`(equal (syntax-after (point)) (string-to-syntax ".")`
in `idris-thing-at-point` be evaluated to nil (false)
and throw error.
Fixes:
https://github.com/idris-community/idris2-mode/issues/16
---
idris-commands.el | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/idris-commands.el b/idris-commands.el
index 893abb8a98..8a1fea840c 100644
--- a/idris-commands.el
+++ b/idris-commands.el
@@ -326,14 +326,17 @@ Idris process. This sets the load position to point, if
there is one."
(error "Cannot find file for current buffer")))
+(defun idris-operator-at-position-p (pos)
+ "Return t if syntax lookup is `.' or char after POS is `-'."
+ (or (equal (syntax-after pos) (string-to-syntax "."))
+ (eq (char-after pos) ?-)))
+
(defun idris-thing-at-point ()
"Return the line number and name at point as a cons.
Use this in Idris source buffers."
(let ((line (idris-get-line-num (point))))
(cons
- (if (equal (syntax-after (point))
- (string-to-syntax "."))
- ;; We're on an operator.
+ (if (idris-operator-at-position-p (point))
(save-excursion
(skip-syntax-backward ".")
(let ((beg (point)))
- [nongnu] elpa/idris-mode updated (fdbd019cb2 -> d08fd3ec78), ELPA Syncer, 2022/12/01
- [nongnu] elpa/idris-mode e31fe83a40 02/14: Remove generated clause from `AddClause.idr` to, ELPA Syncer, 2022/12/01
- [nongnu] elpa/idris-mode 5d0c82679a 05/14: Remove unused `idris-hole-list-buffer-visible-p`, ELPA Syncer, 2022/12/01
- [nongnu] elpa/idris-mode b35ac9740e 10/14: Use `idris-process-buffer-name` instead of `(idris-buffer-name :process)`, ELPA Syncer, 2022/12/01
- [nongnu] elpa/idris-mode fbe5e363c4 11/14: Use `idris-connection-buffer-name` instead of `(idris-buffer-name :connection)`, ELPA Syncer, 2022/12/01
- [nongnu] elpa/idris-mode 38f2839b58 08/14: Use `let ((buffer-read-only nil)` instead of `setq ..`, ELPA Syncer, 2022/12/01
- [nongnu] elpa/idris-mode 1382948269 01/14: Consider - as operator in idris-thing-at-point,
ELPA Syncer <=
- [nongnu] elpa/idris-mode e8109f9ac0 04/14: Remove Idris event logging from `make test3`, ELPA Syncer, 2022/12/01
- [nongnu] elpa/idris-mode 0093e0b42c 13/14: Merge pull request #576 from keram/hole-list, ELPA Syncer, 2022/12/01
- [nongnu] elpa/idris-mode d08fd3ec78 14/14: Merge pull request #569 from keram/idris2-mode-issues-16, ELPA Syncer, 2022/12/01
- [nongnu] elpa/idris-mode f3a032c194 03/14: Add test for `idris-add-clause`, ELPA Syncer, 2022/12/01
- [nongnu] elpa/idris-mode 391963a94c 09/14: Use `idris-repl-buffer-name` instead of `(idris-buffer-name :repl)`, ELPA Syncer, 2022/12/01
- [nongnu] elpa/idris-mode 2c1329b086 06/14: Use `idris-notes-buffer-name` in idris-commands.el, ELPA Syncer, 2022/12/01
- [nongnu] elpa/idris-mode 17d9b1593f 07/14: Make hole-list buffer derived from special-mode, ELPA Syncer, 2022/12/01
- [nongnu] elpa/idris-mode 195b432903 12/14: Merge pull request #574 from keram/minor-internal-impro, ELPA Syncer, 2022/12/01