fix: fix out of bound error for citre-bounds-of-sym-or-op-at-point.#191
Merged
AmaiKinono merged 1 commit intouniversal-ctags:masterfrom Oct 15, 2025
Merged
fix: fix out of bound error for citre-bounds-of-sym-or-op-at-point.#191AmaiKinono merged 1 commit intouniversal-ctags:masterfrom
citre-bounds-of-sym-or-op-at-point.#191AmaiKinono merged 1 commit intouniversal-ctags:masterfrom
Conversation
milanglacier
added a commit
to milanglacier/dotemacs
that referenced
this pull request
Sep 24, 2025
…ng `citre-bounds-of-sym-or-op-at-point' Override the `citre-bounds-of-sym-or-op-at-point'. The reason is that: 1. Fix the out of bound error addressed in universal-ctags/citre#191. 2. We don't really need to check whether the point is an operator, and the frequent `save-excursion' in `citre-bounds-of-sym-or-op-at-point' will impact the auto-completion performance.
|
I second this pull request and want this error to be fixed promptly. When using |
Member
|
Thanks for the fix! However, I believe this is because a logical error in the original code.
diff --git a/citre-common-util.el b/citre-common-util.el
index 795e9cf..555b81d 100644
--- a/citre-common-util.el
+++ b/citre-common-util.el
@@ -179,7 +179,7 @@ goes. CASE-FOLD decides case-sensitivity."
(let ((step-forward (save-excursion (skip-syntax-forward ".")))
(step-backward (save-excursion (skip-syntax-backward "."))))
(unless (and (eq 0 step-forward) (eq 0 step-backward))
- (cons (- (point) step-backward)
+ (cons (+ (point) step-backward)
(+ (point) step-forward))))))In your example: The fixed version returns |
Contributor
Author
|
Thanks for looking into this! I have updated the patch accordingly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the
pointis put at the end of buffer, and the buffer content looks like thiswhere
|is the cursor position,the
citre-bounds-of-sym-or-op-at-pointwill return the buffer position out of bound.This commit fixes the above issue.