Created
January 20, 2021 15:51
-
-
Save ongaeshi/1a011f9ed4f8e63626628a18c79f6c6b to your computer and use it in GitHub Desktop.
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
c = T.current; | |
if(c){ | |
s = "[" + c + "]" | |
if(T.range.len){ | |
T("replaceRange", {text:s, | |
replacingRange:{ loc:T.range.loc, len:c.length }, | |
selectingRange:{ loc:T.range.loc, len:s.length } | |
} ); | |
}else{ | |
T("replaceCurrent",{text:s}); | |
} | |
}else{ | |
s = T.pboard; | |
if(s=="undefined") s = ""; | |
T("insert",{text:s}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment