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

Closed
cwillu opened this Issue Feb 17, 2010 · 3 comments

Comments

Projects
None yet
2 participants
@cwillu

cwillu commented Feb 17, 2010

ul>li*2

results in


    \t

  • \t


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.

@mikecrittenden

This comment has been minimized.

Show comment Hide comment
@mikecrittenden

mikecrittenden Feb 17, 2010

Owner

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.

Owner

mikecrittenden commented Feb 17, 2010

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

This comment has been minimized.

Show comment Hide comment
@cwillu

cwillu Feb 17, 2010

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

cwillu commented Feb 17, 2010

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

@mikecrittenden

This comment has been minimized.

Show comment Hide comment
@mikecrittenden

mikecrittenden Feb 17, 2010

Owner

Nice, committed. Thanks again.

Owner

mikecrittenden commented Feb 17, 2010

Nice, committed. Thanks again.

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment