Skip to content

Commit 743d921

Browse files
Rebuild tags when file is changed
1 parent 67c2486 commit 743d921

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

lua/orgmode/parser/files.lua

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,19 @@ function Files.reload(file, callback)
6666
return Files.load(callback)
6767
end
6868

69+
local onfinish = function()
70+
if callback then
71+
callback()
72+
end
73+
Files._build_tags()
74+
end
75+
6976
local old_file = Files.orgfiles[file]
7077
local new_file = Files.get(file)
7178

7279
if old_file then
7380
Files._check_source_blocks(old_file, new_file)
74-
if callback then
75-
callback()
76-
end
81+
onfinish()
7782
return new_file
7883
end
7984

@@ -83,10 +88,7 @@ function Files.reload(file, callback)
8388
Files._check_source_blocks(old_file, orgfile)
8489
end
8590
Files.loaded = true
86-
if callback then
87-
callback()
88-
end
89-
Files._build_tags()
91+
onfinish()
9092
return orgfile
9193
end)
9294
end

0 commit comments

Comments
 (0)