
StrafeSelection.py
By: a guest on
Jun 27th, 2011 | syntax:
Python | size: 0.89 KB | hits: 67 | expires: Never
#standard modules
import pn
import scintilla
##
# @brief Move selection to the right
# @note Add ALT+Right Arrow Shortcut
@script("Strafe Selection Right", "Text")
def StrafeSelectionRight():
sct = scintilla.Scintilla(pn.CurrentDoc())
#pn.AddOutput("\n Selections:"+str(sct.SelectionCount))
for i in range(sct.SelectionCount):
(a, c) = (sct.GetSelectionNAnchor(i), sct.GetSelectionNCaret(i))
sct.SetSelectionNAnchor (i, a+1)
sct.SetSelectionNCaret (i, c+1)
##
# @brief Move selection to the left
# @note Add ALT+Left Arrow Shortcut
@script("Strafe Selection Left", "Text")
def StrafeSelectionLeft():
sct = scintilla.Scintilla(pn.CurrentDoc())
#pn.AddOutput("\n Selections:"+str(sct.SelectionCount))
for i in range(sct.SelectionCount):
(a, c) = (sct.GetSelectionNAnchor(i), sct.GetSelectionNCaret(i))
sct.SetSelectionNAnchor (i, a-1)
sct.SetSelectionNCaret (i, c-1)