This is an AppleScript that I used with BBEdit to make the text-indent commands behave the way I expected. It has two known defects:
- When multiple lines are selected, they don’t stay that way
- Errors get thrown in end-of-document cases
Beyond that, you’re on your own.
on menuselect(menuName, itemName)
return false
end menuselect
on postmenuselect(menuName, itemName)
tell application "BBEdit"
tell text window 1
select insertion point before last character of selection
end tell
end tell
end postmenuselect
{: lang=applescript }