diff options
| author | Stephen Blott | 2015-01-17 08:16:03 +0000 | 
|---|---|---|
| committer | Stephen Blott | 2015-01-17 08:16:03 +0000 | 
| commit | f24752c8224425075129f9f10ac79bf081619722 (patch) | |
| tree | a0f549840dee5e380c8718693d5a72039d9d0b0d /content_scripts/vimium_frontend.coffee | |
| parent | 8d3665862400b46216c1c42d063890dee1850918 (diff) | |
| download | vimium-f24752c8224425075129f9f10ac79bf081619722.tar.bz2 | |
Add comments for performFindInPlace().
Diffstat (limited to 'content_scripts/vimium_frontend.coffee')
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 5 | 
1 files changed, 4 insertions, 1 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index a6ddffd3..4b132d33 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -703,6 +703,8 @@ handleEnterForFindMode = ->    settings.set("findModeRawQuery", findModeQuery.rawQuery)  performFindInPlace = -> +  # Restore the selection.  That way, we're always searching forward from the same place, so we find the right +  # match as the user adds matching characters, or removes previously-matched characters. See #1434.    findModeRestoreSelection()    query = if findModeQuery.isRegex then getNextQueryFromRegexMatches(0) else findModeQuery.parsedQuery    findModeQueryHasResults = executeFind(query, { caseSensitive: !findModeQuery.ignoreCase }) @@ -927,7 +929,7 @@ getCurrentRange = ->      range    else      selection.collapseToStart() if selection.type == "Range" -    range = selection.getRangeAt 0 +    selection.getRangeAt 0  findModeSaveSelection = ->    findModeInitialRange = getCurrentRange() @@ -938,6 +940,7 @@ findModeRestoreSelection = (range = findModeInitialRange) ->    selection.addRange range  window.enterFindMode = -> +  # Save the selection, so performFindInPlace can restore it.    findModeSaveSelection()    findModeQuery = { rawQuery: "" }    findMode = true  | 
