aboutsummaryrefslogtreecommitdiff
path: root/plugins/indentguide.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/indentguide.lua')
-rw-r--r--plugins/indentguide.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/indentguide.lua b/plugins/indentguide.lua
index 9d903b7..9fc6345 100644
--- a/plugins/indentguide.lua
+++ b/plugins/indentguide.lua
@@ -12,7 +12,11 @@ local function get_line_spaces(doc, idx, dir)
if e == #text then
return get_line_spaces(doc, idx + dir, dir)
end
- return e - s + 1
+ local n = 0
+ for i = s, e do
+ n = n + (text:byte(i) == 9 and config.indent_size or 1)
+ end
+ return n
end