-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Configuration: auto-focus and auto-hide of preview windows #44
Comments
Hey @wookayin I think it's a good idea to support "one off peak" functionality like you mentioned. vim.api.nvim_set_keymap(
"n",
"<leader>pk",
"<cmd>lua require('goto-preview').goto_preview_definition(false, true)<CR>",
{ noremap = true }
) Alternatively I also added support for making this the default behaviour by specifying the new configs in the setup function call require("goto-preview").setup({
default_mappings = true,
resizing_mappings = true,
debug = false,
-- New
dismiss_on_move = true,
focus_on_open = false,
}) Maybe you could test this branch before I merge it? |
Actually I just merged it. Let me know if you run into any problems. |
Thanks for implementing this! However, you could have benefitted from my comments as well before jumping to merging it :) The feature looks good, but there are some things to improve:
|
Not just reasonable, expected. I tested this, in fact I just re-tested it with these options. {
focus_on_open = false,
dismiss_on_move = true,
} And focusing the preview window with |
To make the public APIs open to future extension. See rmagatti#44 and rmagatti#46 for the discussion.
To make the public APIs open to future extension. See rmagatti#44 and rmagatti#46 for the discussion.
Thanks for implementing a great plugin! This might be a question or feature request (if missing).
First, how can I prevent the cursor from automatically being moved to the preview window? I would want to "peek" the definition only, not disturbing the cursor on the main buffer. This should be a configurable option for all the methods, such as
goto_preview_definition(opts)
.Second, I would want to have the preview window automatically closed and dismissed when the cursor moves (assuming the cursor hasn't be taken to the preview window). This is similar to vim-quickui's
persist = 0
option. How can I achieve that? Writing a custompost_open_hook
function for adding autocmd events would be definitely possible, but is there any chance you'd want to implement this is a built-in option?The text was updated successfully, but these errors were encountered: