Skip to content
This repository was archived by the owner on Feb 19, 2023. It is now read-only.

Conversation

@emilienlemaire
Copy link

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
Copy link
Owner

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

@emilienlemaire
Copy link
Author

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
Copy link
Owner

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

@oberblastmeister
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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

local line = lines / 2
opt_default.line = line

local prompt_win, prompt_opt = popup.create('', opt_default)
Copy link
Author

@emilienlemaire emilienlemaire Mar 1, 2021

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.

Copy link
Owner

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 🤦‍♂️

Copy link
Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants