new functions for setting tab width
--HG-- branch : pmacs2
This commit is contained in:
parent
36d363c7bd
commit
a9e1c757af
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue