@@ -300,14 +300,39 @@ function Sidebar:render(tasks)
300300 local lines = {}
301301 local highlights = {}
302302 self .task_lines = {}
303+ local subtask_prefix = " ▐ "
303304 -- Iterate backwards so we show most recent tasks first
304305 for i = # tasks , 1 , - 1 do
305306 local task = tasks [i ]
306307 local detail = self .task_detail [task .id ] or self .default_detail
308+ local start_idx = # lines + 1
309+ local hl_start_idx = # highlights + 1
307310 task :render (lines , highlights , detail )
311+
312+ -- Indent subtasks
313+ if task .parent_id then
314+ for j = start_idx , # lines do
315+ lines [j ] = subtask_prefix .. lines [j ]
316+ end
317+ for j = hl_start_idx , # highlights do
318+ local hl = highlights [j ]
319+ hl [3 ] = hl [3 ] + subtask_prefix :len ()
320+ if hl [4 ] ~= - 1 then
321+ hl [4 ] = hl [4 ] + subtask_prefix :len ()
322+ end
323+ highlights [j ] = hl
324+ end
325+ for j = start_idx , # lines do
326+ table.insert (highlights , { " OverseerTaskBorder" , j , 0 , subtask_prefix :len () })
327+ end
328+ end
308329 table.insert (self .task_lines , { # lines , task })
309330 if i > 1 then
310- table.insert (lines , config .task_list .separator )
331+ if tasks [i - 1 ].parent_id then
332+ table.insert (lines , subtask_prefix .. vim .fn .strcharpart (config .task_list .separator , 2 ))
333+ else
334+ table.insert (lines , config .task_list .separator )
335+ end
311336 table.insert (highlights , { " OverseerTaskBorder" , # lines , 0 , - 1 })
312337 end
313338 end
0 commit comments