Repository navigation
feat(notes): create a note from the List Notes search - #99
Merged
Merged
Conversation
Typing a name in List Notes (Alt+L) that wasn't a note left an empty list (#34). The list now offers to create a note with the typed name, so Enter creates it when nothing matches, and still opens the top match when something does. With Workspace Notes there is one Create entry per section. No Create entry is offered when a note already has the typed name. The list also includes notes in folders, with their folder next to the name; before, only the top level of each location was listed. Creating a note is now one function used by both New Note and List Notes, so both keep a typed extension and only give Markdown notes a heading. It writes with the exclusive flag, so an existing file is never overwritten.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Typing a name in Notes: List Notes (
Alt+L) that wasn't a note left an empty list where Enter did nothing (#34).Changes
Create '<name>'entry is added at the end of the list. If nothing else matches it's the only entry, so Enter creates and opens the note. If something matches, Enter still opens the top match. With Workspace Notes there's one Create entry per section. No Create entry is offered when a note already has the typed name (with or without its extension).createNote, so both keep a typed extension (feat(notes): keep an extension typed with a new note's name #96) and only give Markdown notes a heading. It writes with the exclusive flag, so an existing file is never overwritten.Testing
npm test: 30 passing, 1 new test for matching a typed name to a note.End to end in VS Code 1.140 on macOS, with
animals.md,ideas.txt,sub/more.mdand a hidden.hidden.md:animals.md,ideas.txtanimals.md,ideas.txt,more.md(sub)brand new idea, Enter# brand new ideaand openedanim, Enteranimals.mdopens, Create entry last, no file createdanimalsanimals.md, no Create entrymomore.mdfirst, Create entry lastquery.sql, Enterquery.sqlcreated, emptykickoff.notes/kickoff.mdNew Note from both sections, the "where should it go" question, New Note with a note selected, and the typed extension rules from feat(notes): keep an extension typed with a new note's name #96 were re-run with the same results.
Closes #34.