1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-06 06:44:12 +01:00

Add descriptions to the remaining editor mappings.

This commit is contained in:
Štěpán Němec
2011-02-20 11:01:23 +01:00
parent 76e5f2d474
commit 6317cbc0d8

View File

@@ -507,8 +507,8 @@ var Editor = Module("editor", {
} }
// add mappings for commands like i,a,s,c,etc. in TEXT_EDIT mode // add mappings for commands like i,a,s,c,etc. in TEXT_EDIT mode
function addBeginInsertModeMap(keys, commands) { function addBeginInsertModeMap(keys, commands, description) {
mappings.add([modes.TEXT_EDIT], keys, "", mappings.add([modes.TEXT_EDIT], keys, description || "",
function () { function () {
commands.forEach(function (cmd) commands.forEach(function (cmd)
editor.executeCommand(cmd, 1)); editor.executeCommand(cmd, 1));
@@ -584,13 +584,13 @@ var Editor = Module("editor", {
addMovementMap(["$", "<End>"], "Move to the end of the current line", addMovementMap(["$", "<End>"], "Move to the end of the current line",
false, "intraLineMove", true, "cmd_endLine" , "cmd_selectEndLine"); false, "intraLineMove", true, "cmd_endLine" , "cmd_selectEndLine");
addBeginInsertModeMap(["i", "<Insert>"], []); addBeginInsertModeMap(["i", "<Insert>"], [], "Insert text before the cursor");
addBeginInsertModeMap(["a"], ["cmd_charNext"]); addBeginInsertModeMap(["a"], ["cmd_charNext"], "Append text after the cursor");
addBeginInsertModeMap(["I"], ["cmd_beginLine"]); addBeginInsertModeMap(["I"], ["cmd_beginLine"], "Insert text at the beginning of the line");
addBeginInsertModeMap(["A"], ["cmd_endLine"]); addBeginInsertModeMap(["A"], ["cmd_endLine"], "Append text at the end of the line");
addBeginInsertModeMap(["s"], ["cmd_deleteCharForward"]); addBeginInsertModeMap(["s"], ["cmd_deleteCharForward"], "Delete the character in front of the cursor and start insert");
addBeginInsertModeMap(["S"], ["cmd_deleteToEndOfLine", "cmd_deleteToBeginningOfLine"]); addBeginInsertModeMap(["S"], ["cmd_deleteToEndOfLine", "cmd_deleteToBeginningOfLine"], "Delete the current line and start insert");
addBeginInsertModeMap(["C"], ["cmd_deleteToEndOfLine"]); addBeginInsertModeMap(["C"], ["cmd_deleteToEndOfLine"], "Delete from the cursor to the end of the line and start insert");
function addMotionMap(key, desc, cmd, mode) { function addMotionMap(key, desc, cmd, mode) {
mappings.add([modes.TEXT_EDIT], [key], mappings.add([modes.TEXT_EDIT], [key],