mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-12 05:27:07 +00:00
Clip text when scrolling horizontally
Co-Authored-By: Julia <julia@zed.dev> Co-Authored-By: Piotr <piotr@zed.dev>
This commit is contained in:
parent
b9e98c112f
commit
b0650517ad
1 changed files with 252 additions and 250 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue