-
-
Notifications
You must be signed in to change notification settings - Fork 130
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
Date ranges don't work in body of last headline #307
Comments
I can reproduce this. Furthermore, if I add any line below the date range, even in the same heading, its starts working: I agree with you @Maltimore that the cursor is confusing. It behaves like pasting with Btw: adding a new date in front or in between two dates works fine. It truly must be the end of the last line |
I asked about this parsing error here: milisims/tree-sitter-org#39 but apparently from the tree-sitter side this is the expected behavior. |
Thanks for looking into this. I'm not really sure if it's about timestamps though, I think the culprit is the last line. I've noticed strange behavior on the last line of documents before. Indeed, things seem to have changed. But now I don't get an error message when I try to add a second date, but it instead it changes the first date. Also: I noticed a crucial detail between what I'm doing in the gif and what you wrote in the issue. I have
but you tried
Don't add the dashes, just one space after the timestamp. Still, the last line IS wonky. I'll look into it |
There's an undocumented behavior of nvim-orgmode that is supposed to trigger in exactly your scenario (space after timestamp and cursor after that) where it automatically inserts a date range. I suggested in another issue that I think this (anyways undocumented) behavior is not necessary as it only adds two dashes. |
I also tried looking deeper into it and I saw that when things go wrong, the function |
It's documented here, although hard to catch:
It adds a space after the timestamp. The cursor is on that timestamp and you easily add another one to create a range. We don't do that atm. After inserting a timestamp, the cursor is on the closing angled bracket. To create a range you have to
Also, doing that will currently leave a trailing whitespace. But changing the current behavior to match the one in emacs will leave trailing whitespace after every inserted timestamp :/ |
This issue should be resolved for some time now.
For this, I did some changes how we append dates and explained it here #489 (comment) |
Works perfectly, thank you!! |
Describe the bug
Probably related to #303
Steps to reproduce
<leader>oi.
[orgmode] Failed to parse current headline. Make sure there are no errors in the document.
Expected behavior
date added
Emacs functionality
date added
Minimal init.lua
used default minimal_init.lua
Screenshots and recordings
No response
OS / Distro
ubuntu 20.04, alacritty
Neovim version/commit
master
Additional context
By the way, is it on purpose that when I do
<leader>oi.
to add a date (anywhere, not just in this specific context), the date gets put before the cursor and not after it? It doesn't make so much sense to me that it gets put before the cursor. I can open a separate issue if you want.The text was updated successfully, but these errors were encountered: