diff --git a/main.js b/main.js index 7599552..7d1b6a2 100644 --- a/main.js +++ b/main.js @@ -1691,7 +1691,7 @@ function showgrepresult(needle, grepresult) function showgrep() { - var text = prompt("Search:"); + var text = prompt("Search:", md.selectionEnd > md.selectionStart ? md.value.substr(md.selectionStart, md.selectionEnd - md.selectionStart).trim() : ""); if (text) { showgrepresult(text, grep(text));