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

Đang mở
#899 6 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
lua
Lĩnh vực
tooling

Hướng nghiên cứu

Bắt đầu bằng cách xác định các entry point org_move_subtree_up và org_move_subtree_down, rồi tái hiện hành vi với tệp org được nêu trong issue. Kiểm tra cách mỗi binding di chuyển các tiêu đề và giữ nguyên trạng thái folding. Được xem là hoàn tất khi các folding hiện có vẫn không thay đổi sau khi di chuyển tiêu đề phụ 3 lên hoặc xuống trong cả hai kịch bản đã được báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Lua
Star
3.9k
Fork
193
Merge trung bình
5 ngày 7 giờ
Pull request đã merge (30 ngày)
6

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của nvim-orgmode/orgmode

Tất cả issue của nvim-orgmode/orgmode

Issue tương tự

Thêm issue về Lua

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.