diff --git a/data/core/statusview.lua b/data/core/statusview.lua index 182c782a..59065682 100644 --- a/data/core/statusview.lua +++ b/data/core/statusview.lua @@ -222,6 +222,20 @@ function StatusView:register_docview_items() get_item = function() local dv = core.active_view local line, col = dv.doc:get_selection() + local _, indent_size = dv.doc:get_indent_info() + -- Calculating tabs when the doc is using the "hard" indent type. + local ntabs = 0 + local last_idx = 0 + while last_idx < col do + local s, e = string.find(dv.doc.lines[line], "\t", last_idx, true) + if s and s < col then + ntabs = ntabs + 1 + last_idx = e + 1 + else + break + end + end + col = col + ntabs * (indent_size - 1) return { style.text, line, ":", col > config.line_limit and style.accent or style.text, col, @@ -1159,5 +1173,4 @@ function StatusView:draw() end end - return StatusView