Do not assume doc.indent_info is present

This commit is contained in:
Francesco Abbate 2021-03-05 23:47:36 +01:00
parent 09332fe242
commit aa1408c01f
1 changed files with 2 additions and 2 deletions

View File

@ -108,8 +108,8 @@ function StatusView:get_items()
local line, col = dv.doc:get_selection() local line, col = dv.doc:get_selection()
local dirty = dv.doc:is_dirty() local dirty = dv.doc:is_dirty()
local indent = dv.doc.indent_info local indent = dv.doc.indent_info
local indent_label = indent.type == "hard" and "tabs: " or "spaces: " local indent_label = (indent and indent.type == "hard") and "tabs: " or "spaces: "
local indent_size = tostring(indent.size) .. (indent.confirmed and "" or "*") local indent_size = indent and tostring(indent.size) .. (indent.confirmed and "" or "*") or "unknown"
return { return {
dirty and style.accent or style.text, style.icon_font, "f", dirty and style.accent or style.text, style.icon_font, "f",