mirror of https://github.com/helix-editor/helix
added 'shift_left' and 'shift_right' to Rect
parent
7c8e6792f7
commit
940b1e6357
|
@ -213,8 +213,7 @@ impl EditorView {
|
||||||
|
|
||||||
let gutter_width = view.gutter_offset(doc);
|
let gutter_width = view.gutter_offset(doc);
|
||||||
if gutter_width > 0 {
|
if gutter_width > 0 {
|
||||||
let mut gutter_area = inner.with_width(gutter_width);
|
let gutter_area = inner.with_width(gutter_width).shift_left(gutter_width);
|
||||||
gutter_area.x -= gutter_width;
|
|
||||||
|
|
||||||
Self::render_gutter(
|
Self::render_gutter(
|
||||||
editor,
|
editor,
|
||||||
|
|
|
@ -710,7 +710,7 @@ pub struct NullspaceConfig {
|
||||||
impl Default for NullspaceConfig {
|
impl Default for NullspaceConfig {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
enable: true,
|
enable: false,
|
||||||
pattern: String::from("╲"),
|
pattern: String::from("╲"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,6 +153,22 @@ impl Rect {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns a new Rect shifted left.
|
||||||
|
pub fn shift_left(self, shift: u16) -> Rect {
|
||||||
|
Rect {
|
||||||
|
x: self.x - shift,
|
||||||
|
..self
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns a new Rect shifted left.
|
||||||
|
pub fn shift_right(self, shift: u16) -> Rect {
|
||||||
|
Rect {
|
||||||
|
x: self.x + shift,
|
||||||
|
..self
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Returns a new Rect with height reduced from the bottom.
|
// Returns a new Rect with height reduced from the bottom.
|
||||||
// This does _not_ change the `y` coordinate.
|
// This does _not_ change the `y` coordinate.
|
||||||
pub fn clip_bottom(self, height: u16) -> Rect {
|
pub fn clip_bottom(self, height: u16) -> Rect {
|
||||||
|
|
Loading…
Reference in New Issue