add selected text to finds prompt

This commit is contained in:
nightwing 2011-08-18 18:35:40 +05:00
commit fcd7919fdc

View file

@ -95,7 +95,7 @@ canon.addCommand({
name: "find",
bindKey: bindKey("Ctrl-F", "Command-F"),
exec: function(env, args, request) {
var needle = prompt("Find:");
var needle = prompt("Find:", env.editor.getCopyText());
env.editor.find(needle);
}
});
@ -103,7 +103,7 @@ canon.addCommand({
name: "replace",
bindKey: bindKey("Ctrl-R", "Command-Option-F"),
exec: function(env, args, request) {
var needle = prompt("Find:");
var needle = prompt("Find:", env.editor.getCopyText());
if (!needle)
return;
var replacement = prompt("Replacement:");