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".
This commit is contained in:
Seongjae Lee
2015-09-11 22:46:06 -07:00
parent 09d0efc06f
commit 273d506f38
+6
View File
@@ -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