crittermike / zen-coding-gedit

Integration of Zen Coding (a set of plugins for high-speed HTML and CSS coding) into a Gedit plugin
Other
97 stars 22 forks source link

Tabs inside replacements should be replaced by the configured indentation #3

Closed cwillu closed 14 years ago

cwillu commented 14 years ago
ul>li*2

results in

even though the plugin's indentation is set to " " (two spaces).

Adding "after = after.replace('\t', indent)" to init.py:expand_zencode(self, window)" would suffice to correct this.

In an ideal world, the indentation would be picked up from the editor's settings rather than configured separately for the plugin.

import gconf
tab_size = gconf.client_get_default().get_int("/apps/gedit-2/preferences/editor/tabs/tabs_size")
spaces = gconf.client_get_default().get_bool("/apps/gedit-2/preferences/editor/tabs/insert_spaces")

Will grab the setting, although I don't think this is the per-editor setting. Still, better this than having to edit a settings file and restart gedit each time I switch to a different file with a different indentation scheme.

crittermike commented 14 years ago

I just committed this bit of code to init.py http://gist.github.com/306749

That should be grabbing the current document's tab settings and using that instead of the general default. Let me know if you still have problems.

Again, thanks so much for these reports. Keep em coming if you can.

cwillu commented 14 years ago

Use http://gist.github.com/306753 instead:
" " * 5 == " "

crittermike commented 14 years ago

Nice, committed. Thanks again.