Folding is not respected when using `org_move_subtree_up` or `org_move_subtree_down`

オープン
#899 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
lua
領域
tooling

調査の方向性

まず org_move_subtree_up と org_move_subtree_down のエントリーポイントを見つけ、issue に示されている org ファイルで動作を再現します。各 binding が見出しをどのように移動し、折りたたみ状態を保持するかを調べます。報告された両方のシナリオでサブ見出し 3 を上下に移動した後も、既存の折りたたみが変更されないことを確認できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug
Describe the bug

When moving headlines with those bindings the foldings are not respected

Steps to reproduce

Using the next file as a base:

* heading 1
** subheading 2
** subheading 3
*** subsubheading 1
    text
**** subsubsubheading1
    text
  • If you unfold the first level and use org_move_subtree_up on the subheading 3, it will move the headline but it will fold everything so that you only see heading 1
  • If you show the folds below subheading 3 (but not enough to see subsubsubheading1) and use org_move_subtree_down, then all folds are open:

Image

Expected behavior

Folds are respected when moving headlines around

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",
				},
			})
		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.4

Additional context

No response

主要言語
Lua
スター
3.9k
フォーク
193
平均マージ
5日 7時間
マージ済み PR(30日)
6

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nvim-orgmode/orgmode のほかの issue

nvim-orgmode/orgmode の issue をすべて見る

似ている issue

Lua の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。