oberblastmeister / neuron.nvim

Make neovim the best note taking application
MIT License
396 stars 34 forks source link

Add a prompt to create new named zettels #15

Open emilienlemaire opened 3 years ago

emilienlemaire commented 3 years ago

This new feature would allow to create new Zettels with names.

The current way with telescope is not enough since the string doesn't have to match 100% for telescope to find a Zettel.

The user can call require('neuron.prompt').prompt_new_zettel() to see a small prompt asking for the new id of the file. If it exists it's opened and edited, else it's created and edited.

oberblastmeister commented 3 years ago

since we already use popup.nvim for telescope, can you use that implementation for the floating window so there is no code duplication.

emilienlemaire commented 3 years ago

Well I wanted to use the telescope popups from start, but the are only created in Pickers:find(), which means we should have a picker first for the creation of one note, which I don't think is a good idea, since the features only aims to create a new one, or only open it if the name matches exactly the entry.

oberblastmeister commented 3 years ago

I mean use the library that creates popups for telescope which is popup.nvim, no need to create a telescope picker

oberblastmeister commented 3 years ago

To clarify, you are writing floating window code that can be replaced by using an existing implementation such as popup.nvim which creates floating windows and is also used for telescope. For code reuse purposes

emilienlemaire commented 3 years ago

Well, after reading the telescope code for displaying the pickers, I only saw this way of doing it, maybe I missed a part. I think I’m already using popup.nvim. I’ll look it up a bit more in depth later this week.

oberblastmeister commented 3 years ago

can't you just do popup.create(...)?