From 6317cbc0d8603083ecbf987cff485bf23af4f4be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20N=C4=9Bmec?= Date: Sun, 20 Feb 2011 11:01:23 +0100 Subject: [PATCH] Add descriptions to the remaining editor mappings. --- common/content/editor.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/common/content/editor.js b/common/content/editor.js index 58870f1d..33db7b5b 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -507,8 +507,8 @@ var Editor = Module("editor", { } // add mappings for commands like i,a,s,c,etc. in TEXT_EDIT mode - function addBeginInsertModeMap(keys, commands) { - mappings.add([modes.TEXT_EDIT], keys, "", + function addBeginInsertModeMap(keys, commands, description) { + mappings.add([modes.TEXT_EDIT], keys, description || "", function () { commands.forEach(function (cmd) editor.executeCommand(cmd, 1)); @@ -584,13 +584,13 @@ var Editor = Module("editor", { addMovementMap(["$", ""], "Move to the end of the current line", false, "intraLineMove", true, "cmd_endLine" , "cmd_selectEndLine"); - addBeginInsertModeMap(["i", ""], []); - addBeginInsertModeMap(["a"], ["cmd_charNext"]); - addBeginInsertModeMap(["I"], ["cmd_beginLine"]); - addBeginInsertModeMap(["A"], ["cmd_endLine"]); - addBeginInsertModeMap(["s"], ["cmd_deleteCharForward"]); - addBeginInsertModeMap(["S"], ["cmd_deleteToEndOfLine", "cmd_deleteToBeginningOfLine"]); - addBeginInsertModeMap(["C"], ["cmd_deleteToEndOfLine"]); + addBeginInsertModeMap(["i", ""], [], "Insert text before the cursor"); + addBeginInsertModeMap(["a"], ["cmd_charNext"], "Append text after the cursor"); + addBeginInsertModeMap(["I"], ["cmd_beginLine"], "Insert text at the beginning of the line"); + addBeginInsertModeMap(["A"], ["cmd_endLine"], "Append text at the end of the line"); + addBeginInsertModeMap(["s"], ["cmd_deleteCharForward"], "Delete the character in front of the cursor and start insert"); + addBeginInsertModeMap(["S"], ["cmd_deleteToEndOfLine", "cmd_deleteToBeginningOfLine"], "Delete the current line and start insert"); + addBeginInsertModeMap(["C"], ["cmd_deleteToEndOfLine"], "Delete from the cursor to the end of the line and start insert"); function addMotionMap(key, desc, cmd, mode) { mappings.add([modes.TEXT_EDIT], [key],