Created
June 1, 2010 19:44
-
-
Save rgieseke/421382 to your computer and use it in GitHub Desktop.
Rectangular selection for Textadept
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
keys.ar = {function() | |
local t = _G.textadept | |
t.statusbar_text = 'Rectangular selection' | |
t.events.handle('update_ui') | |
t.events.add_handler('keypress', function(code, shift, control, alt) | |
local left, up, right, down, esc = 65361, 65362, 65363, 65364, 65307 | |
if alt and code == left then | |
buffer:char_left_rect_extend() | |
return true | |
elseif alt and code == up then | |
buffer:line_up_rect_extend() | |
return true | |
elseif alt and code == right then | |
buffer:char_right_rect_extend() | |
return true | |
elseif alt and code == down then | |
buffer:line_down_rect_extend() | |
return true | |
else | |
table.remove(textadept.events['keypresss'], 1) | |
t.statusbar_text = '' | |
t.events.handle('update_ui') | |
return | |
end | |
end | |
, 1) | |
end | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment