From 1bc45c8b3a6d61a8857e3bacbe2341192bb44dd2 Mon Sep 17 00:00:00 2001 From: Rolo Date: Thu, 3 Apr 2025 14:36:17 -0700 Subject: [PATCH] refactor: change empty check to `is_empty` instead of `len > 0` --- helix-term/src/ui/prompt.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs index 03adeb05b..3c97a93cd 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, 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