refactor: change empty check to `is_empty` instead of `len > 0`

pull/13283/head
Rolo 2025-04-03 14:36:17 -07:00 committed by Michael Davis
parent f857a98671
commit 1bc45c8b3a
1 changed files with 1 additions and 1 deletions

View File

@ -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