Skip to content

Commit 2e8410c

Browse files
committed
refactor: move auto setting org_adapt_indentation to Config:extend
See #627 (comment)
1 parent cac865a commit 2e8410c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

ftplugin/org.lua

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ config:setup_mappings('text_objects')
1111
config:setup_foldlevel()
1212

1313
if config.org_startup_indented then
14-
config.org_adapt_indentation = not config.org_indent_mode_turns_off_org_adapt_indentation
1514
vim.b.org_indent_mode = true
1615
end
1716
require("orgmode.org.indent").setup()

lua/orgmode/config/init.lua

+3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ function Config:extend(opts)
4040
opts.org_priority_default = self.opts.org_priority_default
4141
end
4242
self.opts = vim.tbl_deep_extend('force', self.opts, opts)
43+
if self.org_startup_indented then
44+
self.org_adapt_indentation = not self.org_indent_mode_turns_off_org_adapt_indentation
45+
end
4346
return self
4447
end
4548

0 commit comments

Comments
 (0)