Clip text when scrolling horizontally

Co-Authored-By: Julia <julia@zed.dev>
Co-Authored-By: Piotr <piotr@zed.dev>
This commit is contained in:
Antonio Scandurra 2023-11-07 15:50:18 +01:00
parent b9e98c112f
commit b0650517ad

View file

@ -777,6 +777,7 @@ impl EditorElement {
let line_end_overshoot = 0.15 * layout.position_map.line_height;
let whitespace_setting = editor.buffer.read(cx).settings_at(0, cx).show_whitespaces;
cx.with_content_mask(ContentMask { bounds }, |cx| {
// todo!("cursor region")
// cx.scene().push_cursor_region(CursorRegion {
// bounds,
@ -886,8 +887,8 @@ impl EditorElement {
let cursor_column = cursor_position.column() as usize;
let cursor_character_x = cursor_row_layout.x_for_index(cursor_column);
let mut block_width =
cursor_row_layout.x_for_index(cursor_column + 1) - cursor_character_x;
let mut block_width = cursor_row_layout.x_for_index(cursor_column + 1)
- cursor_character_x;
if block_width == Pixels::ZERO {
block_width = layout.position_map.em_width;
}
@ -1068,6 +1069,7 @@ impl EditorElement {
// cx.scene().pop_stacking_context();
// }
})
}
fn scrollbar_left(&self, bounds: &Bounds<Pixels>) -> Pixels {