From b77b1c022125647d3b49b5ef6c56de29efe1d93f Mon Sep 17 00:00:00 2001 From: Guldoman Date: Sat, 20 Nov 2021 03:15:08 +0100 Subject: [PATCH] Add `Doc:get_indent_info` It returns the indentation type, size and confirmation status, used by the `Doc`. --- data/core/doc/init.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/data/core/doc/init.lua b/data/core/doc/init.lua index 640e9fd5..bdf6263a 100644 --- a/data/core/doc/init.lua +++ b/data/core/doc/init.lua @@ -115,6 +115,14 @@ function Doc:clean() end +function Doc:get_indent_info() + if not self.indent_info then return config.tab_type, config.indent_size, false end + return self.indent_info.type or config.tab_type, + self.indent_info.size or config.indent_size, + self.indent_info.confirmed +end + + function Doc:get_change_id() return self.undo_stack.idx end