Skip to content

Commit 7bb47fd

Browse files
Parse file level category directive
1 parent 1473218 commit 7bb47fd

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

lua/orgmode/org/autocompletion/omni.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ local config = require('orgmode.config')
33
local Hyperlinks = require('orgmode.org.hyperlinks')
44

55
local data = {
6-
directives = { '#+title', '#+author', '#+email', '#+name', '#+filetags', '#+archive', '#+options' },
6+
directives = { '#+title', '#+author', '#+email', '#+name', '#+filetags', '#+archive', '#+options', '#+category' },
77
begin_blocks = { '#+begin_src', '#+end_src', '#+begin_example', '#+end_example' },
88
properties = { ':PROPERTIES:', ':END:', ':LOGBOOK:', ':STYLE:', ':REPEAT_TO_STATE:', ':CUSTOM_ID:', ':CATEGORY:' },
99
metadata = { 'DEADLINE:', 'SCHEDULED:', 'CLOSED:' },

lua/orgmode/parser/file.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,9 @@ function File:_parse_directives()
397397
if directive_name == 'archive' then
398398
self.archive_location = config:parse_archive_location(self.filename, directive.value.text)
399399
end
400+
if directive_name == 'category' then
401+
self.category = directive.value.text
402+
end
400403
end
401404
self.tags = tags
402405
end

tests/plenary/org/autocompletion_spec.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ describe('Autocompletion', function()
138138
{ menu = '[Org]', word = '#+filetags' },
139139
{ menu = '[Org]', word = '#+archive' },
140140
{ menu = '[Org]', word = '#+options' },
141+
{ menu = '[Org]', word = '#+category' },
141142
{ menu = '[Org]', word = '#+begin_src' },
142143
{ menu = '[Org]', word = '#+end_src' },
143144
{ menu = '[Org]', word = '#+begin_example' },

0 commit comments

Comments
 (0)