aboutsummaryrefslogtreecommitdiff
path: root/helix-tui/src/widgets/block.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-tui/src/widgets/block.rs')
-rw-r--r--helix-tui/src/widgets/block.rs26
1 files changed, 13 insertions, 13 deletions
diff --git a/helix-tui/src/widgets/block.rs b/helix-tui/src/widgets/block.rs
index 648c2d7e..26223c3e 100644
--- a/helix-tui/src/widgets/block.rs
+++ b/helix-tui/src/widgets/block.rs
@@ -15,12 +15,12 @@ pub enum BorderType {
}
impl BorderType {
- pub fn line_symbols(border_type: BorderType) -> line::Set {
+ pub fn line_symbols(border_type: Self) -> line::Set {
match border_type {
- BorderType::Plain => line::NORMAL,
- BorderType::Rounded => line::ROUNDED,
- BorderType::Double => line::DOUBLE,
- BorderType::Thick => line::THICK,
+ Self::Plain => line::NORMAL,
+ Self::Rounded => line::ROUNDED,
+ Self::Double => line::DOUBLE,
+ Self::Thick => line::THICK,
}
}
}
@@ -140,14 +140,14 @@ impl<'a> Widget for Block<'a> {
// Sides
if self.borders.intersects(Borders::LEFT) {
for y in area.top()..area.bottom() {
- buf.get_mut(area.left(), y)
+ buf[(area.left(), y)]
.set_symbol(symbols.vertical)
.set_style(self.border_style);
}
}
if self.borders.intersects(Borders::TOP) {
for x in area.left()..area.right() {
- buf.get_mut(x, area.top())
+ buf[(x, area.top())]
.set_symbol(symbols.horizontal)
.set_style(self.border_style);
}
@@ -155,7 +155,7 @@ impl<'a> Widget for Block<'a> {
if self.borders.intersects(Borders::RIGHT) {
let x = area.right() - 1;
for y in area.top()..area.bottom() {
- buf.get_mut(x, y)
+ buf[(x, y)]
.set_symbol(symbols.vertical)
.set_style(self.border_style);
}
@@ -163,7 +163,7 @@ impl<'a> Widget for Block<'a> {
if self.borders.intersects(Borders::BOTTOM) {
let y = area.bottom() - 1;
for x in area.left()..area.right() {
- buf.get_mut(x, y)
+ buf[(x, y)]
.set_symbol(symbols.horizontal)
.set_style(self.border_style);
}
@@ -171,22 +171,22 @@ impl<'a> Widget for Block<'a> {
// Corners
if self.borders.contains(Borders::RIGHT | Borders::BOTTOM) {
- buf.get_mut(area.right() - 1, area.bottom() - 1)
+ buf[(area.right() - 1, area.bottom() - 1)]
.set_symbol(symbols.bottom_right)
.set_style(self.border_style);
}
if self.borders.contains(Borders::RIGHT | Borders::TOP) {
- buf.get_mut(area.right() - 1, area.top())
+ buf[(area.right() - 1, area.top())]
.set_symbol(symbols.top_right)
.set_style(self.border_style);
}
if self.borders.contains(Borders::LEFT | Borders::BOTTOM) {
- buf.get_mut(area.left(), area.bottom() - 1)
+ buf[(area.left(), area.bottom() - 1)]
.set_symbol(symbols.bottom_left)
.set_style(self.border_style);
}
if self.borders.contains(Borders::LEFT | Borders::TOP) {
- buf.get_mut(area.left(), area.top())
+ buf[(area.left(), area.top())]
.set_symbol(symbols.top_left)
.set_style(self.border_style);
}