Skip to content
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

Improve org_meta_return coherence on lists #858

Open
lyz-code opened this issue Jan 18, 2025 · 0 comments
Open

Improve org_meta_return coherence on lists #858

lyz-code opened this issue Jan 18, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@lyz-code
Copy link

Describe the bug

I feel that the current behaviour of org_meta_return on lists and checklists is really org_insert_heading_respect_content.

Steps to reproduce

So for example if we have the next file:

* Heading 1  <-- cursor here
  SCHEDULED: <2025-01-18>

If you press org_meta_return you get:

* Heading 1  
* <-- cursor here
  SCHEDULED: <2025-01-18>

If you press org_insert_heading_respect_content you get:

* Heading 1
  SCHEDULED: <2025-01-18>
  
* <-- cursor here

However if you have the next file:

* Heading 1
  - Line 1 <-- cursor here
    - Subline 1

If you press org_meta_return you get:

* Heading 1
  - Line 1
    - Subline 1
  - <-- cursor here

Which is closer to org_insert_heading_respect_content than org_meta_return as it respects the content

Expected behavior

From this file:

* Heading 1
  - Line 1 <-- cursor here
    - Subline 1

If you press org_meta_return you should get:

* Heading 1
  - Line 1
  -  <-- cursor here
    - Subline 1

If you press org_insert_heading_respect_content you get:

* Heading 1
  - Line 1
    - Subline 1
  - <-- cursor here

For me this change would be important because I use more often org_insert_heading_respect_content when dealing with headlines than org_meta_return so it would be a better ux experience for me to use the same key binding for what I'd expect on lists and checklists

Emacs functionality

No response

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"

for _, name in ipairs({ "config", "data", "state", "cache" }) do
	vim.env[("XDG_%s_HOME"):format(name:upper())] = nvim_root .. "/" .. name
end

-- 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",
		"--branch=stable", -- latest stable release
		lazypath,
	})
end
vim.opt.rtp:prepend(lazypath)

require("lazy").setup({
	{
		"nvim-orgmode/orgmode",
		event = "VeryLazy",
		ft = { "org" },
		config = function()
			require("orgmode").setup({
				org_agenda_files = {
					"*.org",
				},
				mappings = {
					capture = {
						org_capture_finalize = "<c-s>",
					},
				},
			})
		end,
	},
}, {
	root = lazy_root,
	lockfile = nvim_root .. "/lazy.json",
	install = {
		missing = false,
	},
})

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

Screenshots and recordings

No response

OS / Distro

linux

Neovim version/commit

0.10.0

Additional context

(Sorry for the issue spam, I usually gather them and once in a while open them all together)

@lyz-code lyz-code added the bug Something isn't working label Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant