File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3232function Highlightsync .onSync (local_path , cached_path , income_path )
3333
3434 local local_highlights = dofile (local_path )
35-
3635 local cached_highlights
3736 local success , result = pcall (dofile , cached_path )
3837 if success then
3938 cached_highlights = result
4039 else
4140 cached_highlights = {}
4241 end
43-
4442 local income_highlights
4543 local success , result = pcall (dofile , income_path )
4644 if success then
4745 income_highlights = result
4846 else
4947 income_highlights = {}
5048 end
51-
52- local annotations = Merge .Merge_highlights (local_highlights ,income_highlights ,cached_highlights )
49+ local annotations = Merge .merge_highlights (local_highlights ,income_highlights ,cached_highlights )
5350
5451 salt .save (annotations ,SidecarDir .. " /" .. FileName .. " .lua" ,true ) -- Save annotations local
5552 DataAnnotations = annotations
Original file line number Diff line number Diff line change @@ -43,14 +43,14 @@ local function get_newer(item1, item2)
4343end
4444
4545-- Function to merge highlights from local, server, and last sync versions
46- function Merge_highlights (local_annotations , server_annotations , last_sync_annotations )
46+ function merge_highlights (local_annotations , server_annotations , last_sync_annotations )
4747 local merged = {}
4848
4949 -- Convert lists into tables indexed by the unique key
5050 local local_map = convert_to_map (local_annotations )
5151 local server_map = convert_to_map (server_annotations )
5252 local last_sync_map = convert_to_map (last_sync_annotations )
53- -- salt.save(server_map,SidecarDir .. "/anotation-server.lua")
53+ -- salt.save(server_map,SidecarDir .. "/anotation-server.lua"):
5454 -- salt.save(local_map, SidecarDir .. "/anotation-local.lua")
5555 -- salt.save(last_sync_map, SidecarDir .. "/anotation-last-sync.lua")
5656 -- Process local highlights
You can’t perform that action at this time.
0 commit comments