Unnamed repository; edit this file 'description' to name the repository.
refactor: change empty check to `is_empty` instead of `len > 0`
Rolo 11 months ago
parent f857a98 · commit 1bc45c8
-rw-r--r--helix-term/src/ui/prompt.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs
index 03adeb05..3c97a93c 100644
--- a/helix-term/src/ui/prompt.rs
+++ b/helix-term/src/ui/prompt.rs
@@ -732,7 +732,7 @@ impl Component for Prompt {
fn cursor(&self, area: Rect, editor: &Editor) -> (Option<Position>, CursorKind) {
let area = area
.clip_left(self.prompt.len() as u16)
- .clip_right(if self.prompt.len() > 0 { 0 } else { 2 });
+ .clip_right(if self.prompt.is_empty() { 2 } else { 0 });
let anchor = self.anchor.min(self.line.len().saturating_sub(1));
let mut col = area.left() as usize