-
Notifications
You must be signed in to change notification settings - Fork 7
feat(ui): add ability to change UI of template selection #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Note(util): pattern = "" for type reason
lua/esqueleto/utils.lua
Outdated
| -- ---@param dir string | ||
| -- ---@param ignored_patterns string[] | ||
| -- ---@return string[] | ||
| -- local listignore = function(dir, ignored_patterns) |
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.
Iter alternative to listignored
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 would add this version but I need to implement proper testing before relying on changing it. Will test it in my local version and decide on wheter we use this one for now.
|
Awesome PR! Just a couple of questions:
Thanks for the awesome work, I was aiming to implementing stuff like this in a near future whenever I was a little more free from work. |
In general, in order to start covering the repository with tests
function(templatenames)
-- Sync call ui.select
-- See: https://github.com/mfussenegger/nvim-dap/blob/66d33b7585b42b7eac20559f1551524287ded353/lua/dap/ui.lua#L55
local co = coroutine.running()
local choicer = function(choice)
if not choice then
vim.notify(
"[esqueleto] No template selected, leaving buffer empty",
vim.log.levels.INFO
)
end
coroutine.resume(co, choice)
end
-- I don't know reason to use that
-- choicer = vim.schedule_wrap(choicer)
vim.ui.select(templatenames, { prompt = "Select skeleton to use:" }, choicer)
return coroutine.yield()
end
I took the very idea of implementing this from here
nevertheless, after checking, I have it open on simple files |
Regarding point 3. I made a mistake on my side, that's why it didn't work. It works as intended so, don't worry. Overall the PR is great, just some stylistic differences that can be revised. Will merge on the weekend after going through everything in the case I need some changes. Thanks! |
|
Haven't merged this since its not working on my local version. Will try to see how I can incorporate this in the coming version. For now I will let it as is and get back to it whenever I finish the other things I'm developing for the plugin. |
|
Could you provide a screen recording of this working? havent been able to make it work in my local version |
|
It indeeds works, dont know why it would not work on my computer. What version of Neovim are you using? I generally work in nightly for plugin dev. |
|
NVIM v0.10.1 |
|
|
||
| -- wrap to coroutine to have possibility to async function | ||
| ---@see esqueleto.selectors.builtin | ||
| coroutine.wrap(function() |
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 think only one breaking chang at that place, if it work correct, then it must work correct either errors exists at another functions
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.
Using this PR, I get the following error:
Error detected while processing BufNewFile Autocommands for "*":
Error executing lua callback: .../latest/nvim-macos-arm64/share/nvim/runtime/filetype.lua:36: BufNewFile Autocommands for "*"..FileType Autocommands for "*"..FileType Autocommands for "*"..FileType Autocomman
ds for "*"..FileType Autocommands for "*"..FileType Autocommands for "*"..FileType Autocommands for "*"..FileType Autocommands for "*"..FileType Autocommands for "*"..FileType Autocommands for "*": Vim(append
):Error executing lua callback: ...s/carlosvigil/git/esqueleto.nvim/lua/esqueleto/utils.lua:182: ...queleto_dev/lazy/plenary.nvim/lua/plenary/popup/init.lua:122: Vim:E218: Autocommand nesting too deep
stack traceback:
[builtin#36]: at 0x01008f59f0
...s/carlosvigil/git/esqueleto.nvim/lua/esqueleto/utils.lua:182: in function 'selecttemplate'
...s/carlosvigil/git/esqueleto.nvim/lua/esqueleto/utils.lua:208: in function 'inserttemplate'
...carlosvigil/git/esqueleto.nvim/lua/esqueleto/autocmd.lua:19: in function <...carlosvigil/git/esqueleto.nvim/lua/esqueleto/autocmd.lua:15>
[builtin#36]: at 0x01008f59f0
...s/carlosvigil/git/esqueleto.nvim/lua/esqueleto/utils.lua:182: in function 'selecttemplate'
...s/carlosvigil/git/esqueleto.nvim/lua/esqueleto/utils.lua:208: in function 'inserttemplate'
...carlosvigil/git/esqueleto.nvim/lua/esqueleto/autocmd.lua:19: in function <...carlosvigil/git/esqueleto.nvim/lua/esqueleto/autocmd.lua:15>
[builtin#36]: at 0x01008f59f0
...s/carlosvigil/git/esqueleto.nvim/lua/esqueleto/utils.lua:182: in function 'selecttemplate'
...s/carlosvigil/git/esqueleto.nvim/lua/esqueleto/utils.lua:208: in function 'inserttemplate'
...
[builtin#36]: at 0x01008f59f0
...s/carlosvigil/git/esqueleto.nvim/lua/esqueleto/utils.lua:182: in function 'selecttemplate'
...s/carlosvigil/git/esqueleto.nvim/lua/esqueleto/utils.lua:208: in function 'inserttemplate'
...carlosvigil/git/esqueleto.nvim/lua/esqueleto/autocmd.lua:19: in function <...carlosvigil/git/esqueleto.nvim/lua/esqueleto/autocmd.lua:15>
[C]: in function 'nvim_cmd'
.../latest/nvim-macos-arm64/share/nvim/runtime/filetype.lua:36: in function <.../latest/nvim-macos-arm64/share/nvim/runtime/filetype.lua:35>
[C]: in function 'pcall'
vim/shared.lua: in function <vim/shared.lua:0>
[C]: in function '_with'
.../latest/nvim-macos-arm64/share/nvim/runtime/filetype.lua:35: in function <.../latest/nvim-macos-arm64/share/nvim/runtime/filetype.lua:10>
stack traceback:
[C]: in function '_with'
.../latest/nvim-macos-arm64/share/nvim/runtime/filetype.lua:35: in function <.../latest/nvim-macos-arm64/share/nvim/runtime/filetype.lua:10>
|
I test it with minimal-minimal setup. DEV_DIR = "~/nvim-plug/esqueleto.nvim"
vim.opt.rtp:prepend(DEV_DIR)
require("esqueleto").setup({patterns = {"python"}}And only 1 that i found, that i should decorate if |
|
I didnt get what you refer to. I prefer you test things with the lazy-based minimal example since the vast majority of user use lazy for pkg management. |
|
Are you cleaning the plugins whenever you launch neovim? I'm using CLI neovim and use the NVIM_APPIMAGE environmental variable to ensure no other plugins are being loaded. I don't know if there is an equivalent in Neovide. |
|
I removed all cached plugins and used a minimal setup and use cli nvim. I had no problems. |
|
Lost for words here. Will have to deep dive into telescope to see what is the problem. Thanks for your help |



inserttablepattern isnil. Ifgettemplatesencountersnil, it will not process it.UIwhen selecting a template process. ( async or not)