new functions for setting tab width

--HG--
branch : pmacs2
This commit is contained in:
moculus 2008-04-02 23:24:52 +00:00
parent 36d363c7bd
commit a9e1c757af
1 changed files with 11 additions and 0 deletions

View File

@ -961,3 +961,14 @@ class SetTabWidth(Method):
def _execute(self, w, **vargs):
w.mode.tabwidth = vargs['width']
w.set_error('Tab width set to %d' % w.mode.tabwidth)
class SetModeTabWidth(Method):
args = [arg('mode', dt='mode', p="Mode: ", h=''),
arg('width', t=type(0), p="Default Tab Width: ", h='New default tab width for mode')]
def _execute(self, w, **vargs):
app, mode = w.application, vargs['mode']
if mode not in app.modes:
w.set_error('Mode %r not found' % mode)
return
app.modes[mode].tabwidth = vargs['width']
w.set_error('Default tab width set to %d' % app.modes[mode].tabwidth)