diff options
Diffstat (limited to 'modules/textadept')
-rw-r--r-- | modules/textadept/keys.lua | 16 | ||||
-rw-r--r-- | modules/textadept/menu.lua | 4 |
2 files changed, 12 insertions, 8 deletions
diff --git a/modules/textadept/keys.lua b/modules/textadept/keys.lua index 36161672..b5fbaa45 100644 --- a/modules/textadept/keys.lua +++ b/modules/textadept/keys.lua @@ -272,8 +272,12 @@ M.utils = { events.emit(events.UPDATE_UI) -- for updating statusbar end, unsplit_all = function() while view:unsplit() do end end, - grow = function(i) if view.size then view.size = view.size + i end end, - shrink = function(i) if view.size then view.size = view.size - i end end, + grow = function() + if view.size then view.size = view.size + buffer:text_height(0) end + end, + shrink = function() + if view.size then view.size = view.size - buffer:text_height(0) end + end, toggle_current_fold = function() buffer:toggle_fold(buffer:line_from_position(buffer.current_pos)) end, @@ -543,15 +547,15 @@ if not CURSES then keys[not OSX and 'cav' or 'cv'] = view_splitv keys[not OSX and 'caw' or 'cw'] = view_unsplit keys[not OSX and 'caW' or 'cW'] = utils.unsplit_all - keys[not OSX and 'ca+' or 'c+'] = {utils.grow, 10} - keys[not OSX and 'ca=' or 'c='] = {utils.grow, 10} - keys[not OSX and 'ca-' or 'c-'] = {utils.shrink, 10} + keys[not OSX and 'ca+' or 'c+'] = utils.grow + keys[not OSX and 'ca=' or 'c='] = utils.grow + keys[not OSX and 'ca-' or 'c-'] = utils.shrink else keys.cmv = { n = view_next, p = view_prev, s = view_splith, v = view_splitv, w = view_unsplit, W = utils.unsplit_all, - ['+'] = {utils.grow, 1}, ['='] = {utils.grow, 1}, ['-'] = {utils.shrink, 1} + ['+'] = utils.grow, ['='] = utils.grow, ['-'] = utils.shrink } if not OSX then keys.cmv.h = view_splith end end diff --git a/modules/textadept/menu.lua b/modules/textadept/menu.lua index 2c35dc4d..0cbf4590 100644 --- a/modules/textadept/menu.lua +++ b/modules/textadept/menu.lua @@ -175,8 +175,8 @@ local menubar = { {_L['Split View _Vertical'], {view.split, view, true}}, {_L['_Unsplit View'], {view.unsplit, view}}, {_L['Unsplit _All Views'], utils.unsplit_all}, - {_L['_Grow View'], {utils.grow, 10}}, - {_L['Shrin_k View'], {utils.shrink, 10}}, + {_L['_Grow View'], utils.grow}, + {_L['Shrin_k View'], utils.shrink}, SEPARATOR, {_L['Toggle Current _Fold'], utils.toggle_current_fold}, SEPARATOR, |