-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong regions of text objects #106
Comments
45mg
added a commit
to 45mg/evil-org-mode
that referenced
this issue
Feb 20, 2024
As described in Issue Somelauw#106. I still don't understand why `region-beginning` was used, but replacing it with `point` gives the exact same behavior, minus the brokenness when visual-mode has been previously activated somewhere outside the subtree at point.
45mg
added a commit
to 45mg/evil-org-mode
that referenced
this issue
Feb 20, 2024
As described in Issue Somelauw#106. I still don't understand why `region-beginning` was used, but replacing it with `point` gives the exact same behavior, minus the brokenness when visual-mode has been previously activated somewhere outside the subtree at point.
45mg
added a commit
to 45mg/evil-org-mode
that referenced
this issue
Feb 20, 2024
As described in Issue Somelauw#106. I still don't understand why `region-beginning` was used, but replacing it with `point` gives the exact same behavior, minus the brokenness when visual-mode has been previously activated somewhere above the subtree at point.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Consider this simple Org file:
Set the point on the first line (
* t|ree
), visually select this line pressingV
and quit visual state with ESC.Then move the point to the
** subtree
and try to delete this subtree using a text objectevil-org-a-subtree
(eval
(apply #'evil-delete (evil-org-a-subtree))
).After that the buffer looks like:
Looking into the code, I've found this function
Documentation of
region-beginning
: Return the integer value of point or mark, whichever is smaller.Since in my case, mark has value smaller than value of point, the region returned by
evil-org-select-an-element
is wrong and includes not only subtree but outer tree as well.I don't know what is rationale for using such an expression here
(min (region-beginning) (org-element-property :begin element))
.If the point was to restrict the lower bound of an element to the user point, then one can replace
(region-beginning)
with(point)
.Another option just return
(org-element-property :begin element)
.The text was updated successfully, but these errors were encountered: