Skip to content

Commit

Permalink
don't automatically dismiss zero width diagnostics
Browse files Browse the repository at this point in the history
Normal diagnostics can be removed when all the text they cover has been removed.
This is not the case for zero width diagnostics as these are not attached to any
particular text. These diagnostics can not be automatically dismissed and must
be mapped as a point instead of as a range to avoid that.
  • Loading branch information
pascalkuthe committed Jan 8, 2024
1 parent 77ab792 commit e0fe50d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions helix-view/src/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1225,6 +1225,10 @@ impl Document {
changes.update_positions(self.diagnostics.iter_mut().map(|diagnostic| {
let assoc = if diagnostic.ends_at_word {
Assoc::AfterWord
} else if diagnostic.zero_width {
// for zero width diagnostics treat the diagnostic as a point
// rather than attachted to some particular text
Assoc::After
} else {
Assoc::Before
};
Expand Down

0 comments on commit e0fe50d

Please sign in to comment.