File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
lua/telescope/_extensions/orgmode Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -32,18 +32,14 @@ return function(opts)
32
32
local dst_headline = entry .value .headline
33
33
if dst_headline then
34
34
-- NOTE: adapted from Capture:refile_to_headline
35
- if src_item and src_item .level <= dst_headline .level then
36
- -- Refiling in same file just moves the lines from one position
37
- -- to another,so we need to apply demote instantly
38
- local is_same_file = dst_file .filename == src_item .root .filename
39
- src_lines = src_item :demote (dst_headline .level - src_item .level + 1 , true , not is_same_file )
40
- end
41
- refile_opts = {
35
+ local is_same_file = dst_file .filename == src_item .root .filename
36
+ src_lines = Capture :_adapt_headline_level (src_item , dst_headline .level , is_same_file )
37
+ local refile_opts = {
42
38
file = dst_file .filename ,
43
39
lines = src_lines ,
44
40
item = src_item ,
45
41
range = Range .from_line (dst_headline .position .end_line ),
46
- headline = dst_headline .position . end_line ,
42
+ headline = dst_headline .title ,
47
43
}
48
44
local refiled = Capture :_refile_to (refile_opts )
49
45
if not refiled then
You can’t perform that action at this time.
0 commit comments