diff options
author | 2010-04-08 20:01:44 -0400 | |
---|---|---|
committer | 2010-04-08 20:01:44 -0400 | |
commit | d7d389404806cf9a512cbe2b7d9700fe983a40d6 (patch) | |
tree | 86201ce2d93ca01e8d236cd2f41c250ea8d483c9 /modules/textadept/lsnippets.lua | |
parent | 9999a72d673df993948216b7ed79f9f77fc53f9d (diff) | |
download | textadept-d7d389404806cf9a512cbe2b7d9700fe983a40d6.tar.gz textadept-d7d389404806cf9a512cbe2b7d9700fe983a40d6.zip |
Respect tab settings for snippets.
Thanks to Rob Gieseke.
Diffstat (limited to 'modules/textadept/lsnippets.lua')
-rw-r--r-- | modules/textadept/lsnippets.lua | 5 |
1 files changed, 5 insertions, 0 deletions
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 = |