sindrets / diffview.nvim

Single tabpage interface for easily cycling through diffs for all modified files for any git rev.
Other
4k stars 109 forks source link

Disable LSP while DiffView is open #294

Closed trevarj closed 1 year ago

trevarj commented 1 year ago

Is there a way to turn off LSP when diffview is open?

My usecase is that, when resolving conflicts with diffview, rust-analyzer (maybe other LSPs too) goes crazy due to the conflict markers (<<<) and then crashes. I'd like to just fully disable the LSP in this scenario.

sindrets commented 1 year ago

There's already an option to disable LSP diagnostics in conflicted files:

:h diffview-config-view.merge_tool.disable_diagnostics

If you actually want to fully stop the LSP, then just run :LspStop. You can use the view_enter + view_leave / view_opened + view_closed hooks to automate this:

:h diffview-config-hooks
trevarj commented 1 year ago

There's already an option to disable LSP diagnostics in conflicted files

Wow, not sure how I missed this. Thanks!