mozers
Silver Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору
Код: command.name.23.*=• Lines -> upwards #~ command.23.*=dostring editor:LineTranspose() editor:LineUp() command.23.*=dostring d=-1 dofile(props["SciteDefaultHome"].."\\tools\\LinesUpDown.lua") command.mode.23.*=subsystem:lua,savebefore:no command.shortcut.23.*=Ctrl+Up command.name.24.*=• Lines -> downwards #~ command.24.*=dostring editor:LineDown() editor:LineTranspose() command.24.*=dostring d=1 dofile(props["SciteDefaultHome"].."\\tools\\LinesUpDown.lua") command.mode.24.*=subsystem:lua,savebefore:no command.shortcut.24.*=Ctrl+Down | LinesUpDown.lua Код: if editor:GetSelText() == "" then local cur_line = editor:LineFromPosition(editor.CurrentPos) local pos_start_cur_line = editor:PositionFromLine(cur_line) local pos_end_cur_line = editor:PositionFromLine(cur_line + 1) editor:SetSel(pos_start_cur_line, pos_end_cur_line) end local sel_start_line = editor:LineFromPosition(editor.SelectionStart) local sel_end_line = editor:LineFromPosition(editor.SelectionEnd) if (sel_start_line>0 and d==-1) or (sel_end_line<editor.LineCount and d==1) then editor:BeginUndoAction() if d==1 then -- Down editor:GotoLine(sel_end_line) for i = sel_end_line-1, sel_start_line, -1 do editor:LineTranspose() editor:LineUp() end else -- Up editor:GotoLine(sel_start_line) for i = sel_start_line, sel_end_line-1 do editor:LineTranspose() editor:LineDown() end end local sel_start = editor:PositionFromLine(sel_start_line+d) local sel_end = editor:PositionFromLine(sel_end_line+d) editor:SetSel(sel_start,sel_end) editor:EndUndoAction() end |
|