note-refactor-obsidian
note-refactor-obsidian copied to clipboard
Unable to create new file name with fuzzy matching an existing one
Hi, thanks for creating this tool!
I'm testing out how it works and noticed that if I have a note with a pretty long title (in my case: "Liu2018_An overview of the influence of atmospheric circulation on the climate in arid and semi-arid region of Central and East Asia")
Then I select some texts in a note, call the "extract selection to new note -- content only" command, it prompts me to "Type file to append to or create".
However, I'm unable to create a new file named "refactor" here, because the fuzzy matching matches all 7 characters of "refactor" in that long note title (highlight as bold).
For ordinary note creation, obsidian has the "shift+Enter" combo to force create a new note even if the fuzzy matching is non-empty. I assume something like this would solve this problem with note-refactor.
+1 to this issue. This is a major issue! — that I don't remember being there in earlier versions.
Regardless of there being fuzzy matches, it should always be an option to create a new note (the one exception being if the user has typed an exact filename match). Two possible solutions:
- The "enter to create" option always appears at the bottom of search results.
- As @Xunius, add the "shift+enter to create" option at the bottom of the modal.
+1 to this issue. This is a major issue! — that I don't remember being there in earlier versions.
Regardless of there being fuzzy matches, it should always be an option to create a new note (the one exception being if the user has typed an exact filename match). Two possible solutions:
1. The "enter to create" option always appears at the bottom of search results. 2. As @Xunius, add the "shift+enter to create" option at the bottom of the modal.
+1
+1 i cant create note for fuzzy search. Shift enter now is dont working.
onChooseItem(item: TFile, evt: MouseEvent | KeyboardEvent): void { if(this.noSuggestion || evt.getModifierState("Shift")) { this.modalNoteCreation.create(this.inputEl.value); } else { this.modalNoteCreation.append(item); } }
please add somebody
Thanks for the suggestion @Xunius and @dipsy but the onChooseItem
method is not called when the Shift modifier key is used.
I have a different fix similar to @dsteinbock's first solution. A check is done when the list of results is returned if the results do not contain a file that matches the user input exactly, an item is included at the top of the list to create the file with the user input as the name.
Thanks for the suggestion @Xunius and @dipsy but the
onChooseItem
method is not called when the Shift modifier key is used.I have a different fix similar to @dsteinbock's first solution. A check is done when the list of results is returned if the results do not contain a file that matches the user input exactly, an item is included at the top of the list to create the file with the user input as the name.
Does this negate the convenience of fuzzy matching? "Basic Note Taking" and all other entries seem to be legit matches, I feel that the user should be able to just hit Enter and get the 1st matching ("Basic Note Taking" in this case) selected.
I am running in the same problem. @lynchjames the last release is 1.7.1 from June 20th, and you merged this PR with the fix on June 21st, so it isn't in the official release yet. Would you mind creating a new release in the meantime or should we rely on manual installation?