Comments (6)
FWIW I had a similar issue because I have the following in my init.lua
:
vim.api.nvim_create_autocmd("BufWritePre", {
pattern = "*",
command = [[mkview]],
})
vim.api.nvim_create_autocmd("BufEnter", {
pattern = "*",
command = [[silent! loadview]],
})
So the code buffer got reset to the last saved view when returning from the input window. The band-aid solution was to just add a vim.cmd[[mkview]]
to my rename shortcut.
This may be entirely irrelevant to your case, but the behaviour is very similar.
from dressing.nvim.
I notice that after you close the rename dialog your cursor has moved to the beginning of the line, which would cause the LSP client to not know what variable to rename (it looks for the one under the cursor). Can you reproduce this cursor-jumping behavior with a minimal example? An easy way to do this would be to make a file with this contents
-- test.lua
vim.ui.input({}, function() end)
edit it and then run :source
.
It would also help if you can do this with a minimal init.lua to eliminate confounding factors from your other plugins.
-- save as repro.lua
-- run with nvim -u repro.lua
-- DO NOT change the paths
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "runtime", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"--single-branch",
"https://github.com/folke/lazy.nvim.git",
lazypath,
})
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
{
"stevearc/dressing.nvim",
config = function()
require("dressing").setup({})
end,
},
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.cmd.colorscheme("tokyonight")
from dressing.nvim.
if I do this, the cursor stays where it should be
from dressing.nvim.
what I noticed is that it renames the position where the cursor was last time in insert mode:
2024-03-19.00-53-22.remuxed.mp4
from dressing.nvim.
@dk949 you're right. If I deactivate the 'Save View for Fold' feature, the plugin issue is resolved.
I have this
-- auto save fold view after exit a file
vim.api.nvim_create_autocmd({ 'BufLeave', 'BufWinLeave', 'InsertLeave' }, {
pattern = { '*.*' },
desc = 'save view (folds), when closing file',
command = 'mkview',
})
-- auto load fold view after enter a file
vim.api.nvim_create_autocmd({ 'BufRead', 'BufWinEnter', 'BufEnter' }, {
pattern = { '*.*' },
desc = 'load view (folds), when opening file',
command = 'silent! loadview',
})
but if I don't use dressing.nvim then there is no conflict with `mkview'
from dressing.nvim.
but if I don't use dressing.nvim then there is no conflict with `mkview'
It's because the default implementation does not open a new window, it just puts you in command mode, so when the input dialog is closed there is no BufEnter
event and the loadview
command isn't executed.
from dressing.nvim.
Related Issues (20)
- Receiving error "attempt to index field 'ctx' (a nil value)" HOT 3
- nui vim.ui.select callback is called twice, HOT 1
- [Question] option to disable titles HOT 2
- `<C-k>` doesn't work, while `<C-j>` does. HOT 3
- Race with concurrent selections in telescope and builtin backends HOT 1
- (select) Telescope code actions failed HOT 4
- [fzf-lua] latest commits in dressing might not be necessary anymore HOT 2
- Nui popup keeps size of first invocation
- FR: Backdrop setting
- Clicking outside telescope select window breaks all vim.ui.select actions HOT 1
- insert_only applies to input but not select boxes HOT 1
- Incorrect installation snippet for Lazy.nvim HOT 1
- Theme of input not matching Readme.md HOT 4
- `input` shows line numbers in normal mode. HOT 1
- FR: Dynamic input width HOT 1
- Suggestion: Make `input.insert_only = false` the default HOT 2
- vim.ui.select telescope: complete hang on focus loss HOT 1
- Feature: Backend for dropbar.nvim
- The selector looks too small and broken with telescope backend
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dressing.nvim.