Merge pull request #1462 from zed-industries/crash-on-goto-diagnostic
Fix two crashes related to diagnostics and bugs in mouse-based columnar selection
This commit is contained in:
commit
6e76bd32da
3 changed files with 116 additions and 110 deletions
|
@ -238,8 +238,10 @@ impl Line {
|
|||
None
|
||||
}
|
||||
|
||||
// If round_to_closest, find the closest index to the given x position
|
||||
// If !round_to_closest, find the largest index before the given x position
|
||||
pub fn len(&self) -> usize {
|
||||
self.layout.len
|
||||
}
|
||||
|
||||
pub fn index_for_x(&self, x: f32) -> Option<usize> {
|
||||
if x >= self.layout.width {
|
||||
None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue