-
Notifications
You must be signed in to change notification settings - Fork 34
Add a prompt to create new named zettels #15
base: unstable
Are you sure you want to change the base?
Add a prompt to create new named zettels #15
Conversation
|
since we already use |
|
Well I wanted to use the |
|
I mean use the library that creates popups for telescope which is popup.nvim, no need to create a telescope picker |
|
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 |
|
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 |
|
can't you just do |
| local line = lines / 2 | ||
| opt_default.line = line | ||
|
|
||
| local prompt_win, prompt_opt = popup.create('', opt_default) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use it here, all the other lines of codes are used to make it appear at the right position and make it look good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh sorry im am just hallucinating 🤦♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ok, I found it quite verbose at the beginning, I had to look up a few times the telescope code to understand how it works and be sure there was no other way.
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.