From a31f3beaa9e5526273c89dda899ba9c29374c439 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Tue, 1 Feb 2011 13:14:08 -0500 Subject: [PATCH] Make t_^ do something sensible. --- common/content/editor.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/common/content/editor.js b/common/content/editor.js index 4e781ba9..14954645 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -77,7 +77,7 @@ var Editor = Module("editor", { // good thing is, we need this code anyway for proper beeping try { if (callable(cmd)) - cmd(editor); + cmd(editor, controller); else controller.doCommand(cmd); didCommand = true; @@ -563,6 +563,10 @@ var Editor = Module("editor", { function _select(editor) { updateRange(editor, forward, re, function (range) {}); } + function beginLine(editor_) { + editor.executeCommand("cmd_beginLine"); + move(true, /\S/)(editor_); + } // KEYS COUNT CARET TEXT_EDIT VISUAL_TEXT_EDIT addMovementMap(["k", ""], true, "lineMove", false, "cmd_linePrevious", selectPreviousLine); @@ -579,7 +583,8 @@ var Editor = Module("editor", { addMovementMap(["", ""], true, "pageMove", false, "cmd_movePageUp", "cmd_selectPreviousPage"); addMovementMap(["gg", ""], false, "completeMove", false, "cmd_moveTop", "cmd_selectTop"); addMovementMap(["G", ""], false, "completeMove", true, "cmd_moveBottom", "cmd_selectBottom"); - addMovementMap(["0", "^", ""], false, "intraLineMove", false, "cmd_beginLine", "cmd_selectBeginLine"); + addMovementMap(["0", ""], false, "intraLineMove", false, "cmd_beginLine", "cmd_selectBeginLine"); + addMovementMap(["^"], false, "intraLineMove", false, beginLine, "cmd_selectBeginLine"); addMovementMap(["$", ""], false, "intraLineMove", true, "cmd_endLine" , "cmd_selectEndLine"); addBeginInsertModeMap(["i", ""], []);