branch: externals/orgalist
commit d22e3919c46801e95ac9ef3464509b5f88e9e99f
Author: Nicolas Goaziou <[email protected]>
Commit: Nicolas Goaziou <[email protected]>

    Fix lax check
    
    * orgalist.el (orgalist--at-item-p): Make sure boundaries are actually
      checked.  Small refactoring.
---
 orgalist.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/orgalist.el b/orgalist.el
index 3ac628d..1d6a765 100644
--- a/orgalist.el
+++ b/orgalist.el
@@ -260,11 +260,11 @@ Return nil if Orgalist mode is not active."
 
 (defun orgalist--at-item-p ()
   "Non-nil if point is at an item."
-  (and (orgalist--boundaries)            ;check context
-       (save-excursion
-         (beginning-of-line)
-         (looking-at-p
-          "[ \t]*\\(?:[-+]\\|\\(?:[a-zA-Z]\\|[0-9]+\\)\\.\\)\\([ 
\t]\\|$\\)"))))
+  (pcase (orgalist--boundaries)
+    (`(,min . ,max)
+     (and (<= min (point))
+          (>= max (point))
+          (org-match-line (concat "[ \t]*" orgalist--bullet-re))))))
 
 (defun orgalist--in-item-p ()
   "Return item beginning position when in a plain list, nil otherwise."

Reply via email to