-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Overhaul tracking of buffer <-> window association
Leaving bad diagnostic highlights in other buffers, or failing to highlight when switching to a buffer cause frequent bugs. The pessimistic approach so far has been to update every visible window very frequently - but this approach doesn't work as well for keeping each window's location list up to date. - Track an incrementing version number of the diagnostics associated with each files to tell when a window's location list is stale. - After setting the location list store window local variables with the current file and version of diagnostics. - When Setting the location list, first check if it needs any change. This reduces the cost of repeated updates. - Add a `clear` method for diagnostics so they can be cleaned up for untracked filetypes. - Replace the frequent `lsc#highlights#updatedDisplayed` with a more targeted method. - Delete the lsc#file#onLeave method since highlights will always be corrected for the new buffer. New approach for correcting state: The previous autocmd did not have the `IfEnabled` condition so the autoload file would always be parsed. Now there are checks for window local variables for both highlights and location list to only call autoloaded functions when necessary. The more precisely targetd updates also mean that in the case of buffer changes only the current window needs to be updated. Some state can't be reliably updated across tabs, so when the tab changes stay a bit pessimistic and do a sanity check across all windows.
- Loading branch information
Showing
4 changed files
with
114 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters