diff options
Diffstat (limited to 'modules/textadept/snippets.lua')
-rw-r--r-- | modules/textadept/snippets.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/textadept/snippets.lua b/modules/textadept/snippets.lua index 0e31e6bb..81a4247f 100644 --- a/modules/textadept/snippets.lua +++ b/modules/textadept/snippets.lua @@ -102,7 +102,9 @@ local function new_snippet(text, trigger) if #lines > 1 then -- Match indentation on all lines after the first. local indent_size = #buffer:get_cur_line():match('^%s*') - if not use_tabs then indent_size = indent_size / buffer.tab_width end + if not use_tabs then + indent_size = math.floor(indent_size / buffer.tab_width) -- for Lua 5.3 + end local additional_indent = indent[use_tabs]:rep(indent_size) for i = 2, #lines do lines[i] = additional_indent..lines[i] end end |