Comments (3)
It seems to be something with when a swap file is written. When I set
set updatetime=0
The float doesn't disappear until I write the file to disk. I think when I write the file to disk that is when the swap file is written as well.
I tried writing to disk with the default update time and the floating window stayed active, apart from a flicker. So I think it is something with writing a swap file and not the buffer's file.
from vim-lsp.
I was facing the same issue. Seems like this may be related to the CursorHold
autocommand which fires after updatetime
milliseconds. From the vim-lsp
code this seems to be by design:
:help updatetime
'updatetime' 'ut' number (default 4000)
global
If this many milliseconds nothing is typed the swap file will be
written to disk (see |crash-recovery|). Also used for the
|CursorHold| autocommand event.
Removing CursorHold
from the line above did not solve the issue but there are other calls to CursorHold
that might be removing floats
from vim-lsp.
Somehow, my Vim seems to be also generating a CursorMove
event along with the CursorHold
event.
So just the removal of the CursorHold
from the list was not enough.
While trying to fix this exact issue I've changed a few things in this area, ultimately adding a configuration option to disable the "hide on CursorHold" behavior:
let g:lsp_diagnostics_float_hide_on_cursor_hold = 0
The first change in the series is posted for review.
If you want to get this functionality before the review process is done, you can apply this to your .vimrc
:
- Plug 'prabirshrestha/vim-lsp'
+ Plug 'ilya-bobyr/vim-lsp'
+ let g:lsp_diagnostics_float_hide_on_cursor_hold = 0
Or, maybe, be even more precise with the exact change you want:
- Plug 'prabirshrestha/vim-lsp'
+ Plug 'ilya-bobyr/vim-lsp', { 'commit': '61e72298180f7937cf5c141e6482ab9cbc64f3b9' }
+ let g:lsp_diagnostics_float_hide_on_cursor_hold = 0
It would also be nice to get someone else to try my changes.
The event processing logic is somewhat tricky.
While it does seem to work for me, there is a chance I broke an existing behavior others rely on.
from vim-lsp.
Related Issues (20)
- No command for `textDocument/pullDiagnostics` feature ? HOT 3
- Get LSP to work with complicated Scala project with git submodules. HOT 1
- Undo in neovim HOT 1
- LSP Workspace Diagnostics
- LSP servers not connecting, Windows 11 HOT 1
- File ownership state is out of sync when doing multiple LspRename on unsaved buffers on multiple files HOT 1
- Restart the lsp server can not work.
- Bug: Updating buffer (open, reload) creates duplicated server-side content when multiple LSP servers are enabled HOT 1
- [Feature request] Install `python-lsp-ruff` plugin with `:LspInstallServer` HOT 1
- LspStopServer only works for a few seconds, server auto-starts
- hope vimlsp recognize progress info
- Diagnostics display as line until hovered? HOT 1
- bug info vim-lsp
- Prettier & ESLint HOT 1
- Text edits with the same start position are applied in reverse HOT 2
- Checking if LSP server is running for a specific filetype
- cursorline and cursor messed up with vim-lsp.
- Add some way to disable diagnostics from a given server
- didChange event removing all contents when closing window shortly after a change HOT 1
- How do you remove the underlines? HOT 3
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 vim-lsp.