From 273d506f387e2d333fe6e71018bf85a8b1e3726a Mon Sep 17 00:00:00 2001 From: Seongjae Lee Date: Fri, 11 Sep 2015 22:46:06 -0700 Subject: [PATCH] Make the searching query to be the non-selected text, not the full text For example, if we have two notes "Car" and "Care", when we type "Ca", then it automatically fills "Care" and drops "Car". (Assume "Care" comes ahead of "Car"). However, we still want to search with "Ca". --- lib/notational-velocity-view.coffee | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/notational-velocity-view.coffee b/lib/notational-velocity-view.coffee index d47be32..0e0bab6 100644 --- a/lib/notational-velocity-view.coffee +++ b/lib/notational-velocity-view.coffee @@ -115,6 +115,12 @@ class NotationalVelocityView extends SelectListView hide: -> @panel?.hide() + getFilterQuery: -> + editor = @filterEditorView.model + fullText = editor.getText() + selectedText = editor.getSelectedText() + return fullText.substring(0, fullText.length - selectedText.length) + populateList: -> filterQuery = @getFilterQuery() filteredItems = null