From 90444bebf9478408c8332a898e7c404d0a62841f Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 1 Feb 2015 16:05:24 +0000 Subject: With find mode history, remember any partial query. --- content_scripts/vimium_frontend.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'content_scripts') diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index b6728ce9..2dcd3d9b 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -779,6 +779,7 @@ handleEnterForFindMode = -> class FindMode extends Mode constructor: -> @historyIndex = -1 + @partialQuery = "" super name: "find" badge: "/" @@ -796,11 +797,12 @@ class FindMode extends Mode else if event.keyCode == keyCodes.upArrow if rawQuery = FindModeHistory.getQuery @historyIndex + 1 @historyIndex += 1 + @partialQuery = findModeQuery.rawQuery if @historyIndex == 0 updateQueryForFindMode rawQuery @suppressEvent else if event.keyCode == keyCodes.downArrow @historyIndex = Math.max -1, @historyIndex - 1 - rawQuery = if 0 <= @historyIndex then FindModeHistory.getQuery @historyIndex else "" + rawQuery = if 0 <= @historyIndex then FindModeHistory.getQuery @historyIndex else @partialQuery updateQueryForFindMode rawQuery @suppressEvent else -- cgit v1.2.3