File tree Expand file tree Collapse file tree 3 files changed +10
-22
lines changed Expand file tree Collapse file tree 3 files changed +10
-22
lines changed Original file line number Diff line number Diff line change @@ -176,14 +176,18 @@ end
176176
177177--- @return OrgTodoKeywords
178178function Config :get_todo_keywords ()
179- if self .todo_keywords then
180- return self .todo_keywords
179+ if not self .todo_keywords then
180+ self .todo_keywords = self : build_todo_keywords ()
181181 end
182- self .todo_keywords = TodoKeywords :new ({
183- org_todo_keywords = self .opts .org_todo_keywords ,
182+ return self .todo_keywords
183+ end
184+
185+ --- @param todo_keywords ? string[] | string[][]
186+ function Config :build_todo_keywords (todo_keywords )
187+ return TodoKeywords :new ({
188+ org_todo_keywords = todo_keywords or self .opts .org_todo_keywords ,
184189 org_todo_keyword_faces = self .opts .org_todo_keyword_faces ,
185190 })
186- return self .todo_keywords
187191end
188192
189193--- Setup mappings for a given category and buffer
Original file line number Diff line number Diff line change @@ -311,10 +311,7 @@ function OrgFile:get_todo_keywords()
311311 table.insert (keywords_data , keywords )
312312 end
313313
314- return require (' orgmode.objects.todo_keywords' ):new ({
315- org_todo_keywords = keywords_data ,
316- org_todo_keyword_faces = config .org_todo_keyword_faces ,
317- })
314+ return config :build_todo_keywords (keywords_data )
318315end
319316
320317--- @return OrgHeadline[]
Original file line number Diff line number Diff line change @@ -52,19 +52,6 @@ function TodoKeywords:find(keyword)
5252 end )
5353end
5454
55- --- @param keyword string
56- --- @return number | nil sequence index this keyword belongs to
57- function TodoKeywords :find_sequence_index (keyword )
58- for seq_idx , seq in ipairs (self .sequences ) do
59- for _ , todo_keyword in ipairs (seq ) do
60- if todo_keyword .value == keyword then
61- return seq_idx
62- end
63- end
64- end
65- return nil
66- end
67-
6855--- @param type OrgTodoKeywordType
6956--- @return OrgTodoKeyword
7057function TodoKeywords :first_by_type (type )
You can’t perform that action at this time.
0 commit comments