Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*=============================
- * upperCase.ms
- ==============================*/
- #command upperCaseKeyword "Keyword"
- var FgKeyword = 8;
- switch(command){
- case "upperCaseKeyword":
- upperCaseKeyword();
- break;
- default:
- error("command [" + command + "] not found");
- break;
- }
- exit();
- function upperCaseKeyword(){
- if(view){
- var selection = getSelection();
- var cur, to;
- if(selection[0].line == selection[1].line &&
- selection[0].index == selection[1].index){
- cur = EP(1);
- to = EP(getLineCount(), getLine(getLineCount()).length);
- }else{
- cur = EP(selection[0].line);
- to = EP(selection[1].line, getLine(selection[1].line).length);
- }
- enterUndoGroup();
- gotoPoint(cur);
- while(cur.line < to.line ||
- (cur.line == to.line && cur.index < to.index)){
- var prev = new Point(cur);
- if(getColorCode() == FgKeyword){
- upperCaseWord();
- }
- if(/^[\r\n]/.test(getText())){
- charRight();
- }else{
- wordRight();
- }
- cur = getCurrentPoint();
- }
- leaveUndoGroup();
- }
- }
Add Comment
Please, Sign In to add comment