Closed GoogleCodeExporter closed 8 years ago
btw in my case zen_jedit.js or zen_eclipse.js:
content = zen_coding.expandAbbreviation(abbr, editor_type, profile_name);
if (zen_settings.variables.indentation != "\t") {
content = content.replace(/\n(\t+)/g, function(tabs){
return tabs.replace(/\t/g, zen_settings.variables.indentation);
});
}
Original comment by szabolcs.kurdi@gmail.com
on 27 Dec 2009 at 1:06
I've actually noticed the same thing with the Python version, zen_core.py. Been
meaning to document it.
# fix indentation
#indent = zen_settings['variables']['indentation']
# This doesn't work
#begin = begin.replace('\\t', indent)
#end = end.replace('\\t', indent)
# This works though
begin = re.sub('\\t', indent, begin)
end = re.sub('\\t', indent, end)
I'm think the replacing of the \n may not work either, but I use \n so it
doesn't get
in my way. I'm also not sure why the original way doesn't work. I don't use
Python a
ton. I actually found even with the above it can have issues with nested
snippets.
Doing to replace on the data variable before it's broken into begin and end
pieces
works out better.
if data:
if profile['tag_nl'] != False:
data = data.replace(r'\n', get_newline())
# fix indentation
indent = zen_settings['variables']['indentation']
data = re.sub('\\t', indent, data)
Original comment by angelw...@gmail.com
on 28 Dec 2009 at 2:41
Since v0.6 (wait until I write some docs) you can change indentation and
newline symbols in runtime. I'll write
about it in PluginHowto
Original comment by serge....@gmail.com
on 15 Feb 2010 at 12:25
Original issue reported on code.google.com by
szabolcs.kurdi@gmail.com
on 27 Dec 2009 at 1:02