nvim-orgmode / orgmode

Orgmode clone written in Lua for Neovim 0.9+.

Home Page:https://nvim-orgmode.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Orgmode mappings for increment/decrement date part under cursor are inverted

evanrittenhouse opened this issue · comments

Describe the bug

The docs in orgmode-mappings say that <C-a> increments the date part under cursor, while <C-x> decrements it. In reality, it's inverted for days/months.

Steps to reproduce

Create a sample TODO, for example:

* INCOMING some other thing                                              
  :DEADLINE: <2024-03-31 Sun> 

Press <C-a> on the year - it becomes 2025. Press <C-a> on the month - it becomes 02. Press <C-a> on the day - it becomes 30.

Expected behavior

<C-a> increments every part of the date under the cursor.

Emacs functionality

No response

Minimal init.lua

Neovim config:

local M = {
  "nvim-orgmode/orgmode",
  dependencies = {
    { "nvim-treesitter/nvim-treesitter", lazy = true },
  },
  -- ft = "Org",
  event = "VeryLazy",
  opts = {
    org_agenda_files = ORG_DIR .. "**/*.org",
    org_default_notes_file = ORG_DIR .. "/refile.org",
    org_todo_keywords = {
      "IDEA(i)",
      "INCOMING(c)",
      "IN PROGRESS(p)",
      "BLOCKED(b)",
      "IN REVIEW(r)",
      "|", -- separates "unfinished" from "finished" states,
      "DONE(d)"
    },
    org_capture_templates = {
      r = {
        description = "Repo",
        template = "* [[%x][%(return string.match('%x', '([^/]+)$'))]]%?",
        target = ORG_DIR .. "repos.org",
      }
    }
  },
}

Screenshots and recordings

No response

OS / Distro

macOS 13.2.1

Neovim version/commit

0.9.5

Additional context

No response

Instead of :DEADLINE: it should be DEADLINE:. That way it will get highlighted and work. It should work anyway so it is a bug, but for your case that is the issue.

:DEADLINE: causes a syntax error with parser so it's not able to detect the date. if you use a name without a leading : it should work.