From d7d389404806cf9a512cbe2b7d9700fe983a40d6 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Thu, 8 Apr 2010 20:01:44 -0400 Subject: Respect tab settings for snippets. Thanks to Rob Gieseke. --- modules/textadept/lsnippets.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/textadept/lsnippets.lua') diff --git a/modules/textadept/lsnippets.lua b/modules/textadept/lsnippets.lua index 92f1b0a5..19f20e28 100644 --- a/modules/textadept/lsnippets.lua +++ b/modules/textadept/lsnippets.lua @@ -344,6 +344,11 @@ function insert(s_text) buffer:begin_undo_action() s_text = handle_escapes(s_text) + -- Take into account tab settings. + if not buffer.use_tabs then + s_text = s_text:gsub('\t', string.rep(' ', buffer.tab_width)) + end + -- Execute Lua and shell code. s_text = s_text:gsub('%%(%b())', run_lua_code) s_text = -- cgit v1.2.3