changeset 6693:bceab2105f9e

refactor: change empty check to `is_empty` instead of `len > 0`
author Rolo <roloedits@gmail.com>
date Thu, 03 Apr 2025 14:36:17 -0700
parents e6d4d05acd27
children a6eef829a2fe
files helix-term/src/ui/prompt.rs
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/helix-term/src/ui/prompt.rs	Thu Apr 03 14:35:35 2025 -0700
+++ b/helix-term/src/ui/prompt.rs	Thu Apr 03 14:36:17 2025 -0700
@@ -732,7 +732,7 @@
     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