editor: Fix panics in CursorPosition::update_position (#41237)
Fixes a regression introduced in https://github.com/zed-industries/zed/pull/39857. As for the exact reason this causes this issue I am not yet sure will investigate (as per the todos in code) Fixes ZED-23R Release Notes: - N/A *or* Added/Fixed/Improved ...
This commit is contained in:
@@ -5742,17 +5742,6 @@ impl MultiBufferSnapshot {
|
||||
debug_ranges.insert(key, text_ranges, format!("{value:?}").into())
|
||||
});
|
||||
}
|
||||
|
||||
// used by line_mode selections and tries to match vim behavior
|
||||
pub fn expand_to_line(&self, range: Range<Point>) -> Range<Point> {
|
||||
let new_start = MultiBufferPoint::new(range.start.row, 0);
|
||||
let new_end = if range.end.column > 0 {
|
||||
MultiBufferPoint::new(range.end.row, self.line_len(MultiBufferRow(range.end.row)))
|
||||
} else {
|
||||
range.end
|
||||
};
|
||||
new_start..new_end
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(test, feature = "test-support"))]
|
||||
|
||||
Reference in New Issue
Block a user