nvim-orgmode / nvim-orgmode/orgmode

org_meta_return doesnt jump below heading content

Open
#775 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Lua
Stars
3.9k
Forks
190
Avg merge
2d 13h
Merged PRs (30d)
7

Description

Describe the bug

org_mappings.meta_return doesnt skip past the contents of the heading

Steps to reproduce
  1. Position cursor on line with heading and multiple lines of content
* Heading | <- Put cursor here
Line 1
Line 2
  1. Call org_mappings.meta_return with the keymap in the minimal_repro
Expected behavior

Heading content should be skipped past

Emacs functionality

Behaves as expected in Emacs

Minimal init.lua

local tmp_dir = vim.env.TMPDIR or vim.env.TMP or vim.env.TEMP or '/tmp'
local nvim_root = tmp_dir .. '/nvim_orgmode'
local lazy_root = nvim_root .. '/lazy'
local lazypath = lazy_root .. '/lazy.nvim'

-- Install lazy.nvim if not already installed
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({ 'git', 'clone', '--filter=blob:none', 'https://github.com/folke/lazy.nvim.git' })
end
vim.opt.rtp:prepend(lazypath)

require('lazy').setup({
  {
    'nvim-orgmode/orgmode',
    event = 'VeryLazy',
    ft = { 'org' },
    config = function()
      require('orgmode').setup()
    end,
  },
}, {
  root = lazy_root,
  lockfile = nvim_root .. '/lazy.json',
  install = {
    missing = false,
  },
})

require('lazy').sync({
  wait = true,
  show = false,
})

vim.keymap.set('i', '<C-CR>', function ()
  require"orgmode".action("org_mappings.meta_return")
end, { buffer = true })

Screenshots and recordings

In nvim-orgmode:
nvim

In Emacs:
emacs

OS / Distro

Windows 10

Neovim version/commit

NVIM v0.10.0 Build type: Release LuaJIT 2.1.1713484068

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the provided minimal init.lua and the org_mappings.meta_return entry point, using the heading and content shown in the report. Trace how the action determines the next insertion position and verify that the cursor moves after the heading's content, matching Emacs behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.