Fix: (org-ql--normalize-from-to-on) Tolerate "-" input
Avoids errors while typing a query (e.g. a negative number) into org-ql-find, which interrupts completion altogether.
This commit is contained in:
parent
3622b92403
commit
f65b1d91a4
2 changed files with 8 additions and 1 deletions
|
|
@ -544,7 +544,8 @@ Simple links may also be written manually in either sexp or non-sexp form, like:
|
||||||
|
|
||||||
** 0.7.2-pre
|
** 0.7.2-pre
|
||||||
|
|
||||||
Nothing new yet.
|
*Fixes*
|
||||||
|
+ Timestamp predicates are more tolerant of partial input (e.g. preventing errors while the user is typing a query into ~org-ql-find~).
|
||||||
|
|
||||||
** 0.7.1
|
** 0.7.1
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1286,6 +1286,9 @@ result form."
|
||||||
to on))
|
to on))
|
||||||
(when from
|
(when from
|
||||||
(setq from (pcase from
|
(setq from (pcase from
|
||||||
|
("-"
|
||||||
|
;; Ignore, because it means the user is typing a negative number.
|
||||||
|
nil)
|
||||||
((or 'today "today") (->> (ts-now)
|
((or 'today "today") (->> (ts-now)
|
||||||
(ts-apply :hour 0 :minute 0 :second 0)))
|
(ts-apply :hour 0 :minute 0 :second 0)))
|
||||||
((pred numberp) (->> (ts-now)
|
((pred numberp) (->> (ts-now)
|
||||||
|
|
@ -1302,6 +1305,9 @@ result form."
|
||||||
((pred ts-p) from))))
|
((pred ts-p) from))))
|
||||||
(when to
|
(when to
|
||||||
(setq to (pcase to
|
(setq to (pcase to
|
||||||
|
("-"
|
||||||
|
;; Ignore, because it means the user is typing a negative number.
|
||||||
|
nil)
|
||||||
((or 'today "today") (->> (ts-now)
|
((or 'today "today") (->> (ts-now)
|
||||||
(ts-apply :hour 23 :minute 59 :second 59)))
|
(ts-apply :hour 23 :minute 59 :second 59)))
|
||||||
((pred numberp) (->> (ts-now)
|
((pred numberp) (->> (ts-now)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue