08-09-2012, 04:59 AM
Macro Macro1809
;Selects text right-to-left, until [ character.
;out
;act "Word"
spe 1 ;;makes faster
str s sPrev; int i j ;;variables
for i 0 1000000000 ;;repeat
,;key SL ;;Shift+Left. Select 1 character backwards.
,key CSL ;;Ctrl+Shift+Left. Select 1 word backwards. Faster.
,s.getsel ;;copy to s
,if(i and s.len<=sPrev.len) break; else sPrev=s ;;exit loop if does not select more
,j=findcr(s '[') ;;find [ character
,if j>=0 ;;if found
,,if(j>0) s.get(s j); for(i 0 j) key SR ;;if selected too far to the left; go back
,,break ;;exit loop
out s ;;show selected text