Somelauw / evil-org-mode

Supplemental evil-mode keybindings to emacs org-mode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Entering a time range using org-time-stamp twice in a row

christianramet opened this issue · comments

Entering a time range using the org-time-stamp interactive function twice should automaticaly append the second one after 2 dashes like so:
<2019-06-08 Sat>--<2019-06-11 Tue>

Currently it will enter the following:
<2019-06-08 Sat--<2019-06-11 Tue>>

Notice the double angular brackets at the end. The closing one of the first time stamp is being pushed because on the second call of the interactive function, the result is being inserted instead of appended.

In emacs mode, calling twice this function in a row works as intended.

I just realized that this feature might be out of the scope of this package as org-time-stamp is not bound to any key with this mapping. The default key being
C-c .
For now I have no idea where else I could fill this issue.

Solved:
(setq evil-move-cursor-back nil)
With this var set to nil, the cursor is moved backwards when exiting Insert state, which allows the intended behavior.

I'm not completely comfortable with this solution as now the cursor behaves in an emacs-y way.

Sources:

emacs-evil/evil-collection#46
https://emacs.stackexchange.com/questions/20148/evil-org-time-stamp-inactive-at-end-of-line-in-normal-mode/20149

And indeed, it was out of the scope of this module.