Run cargo fmt and fix lints

This commit is contained in:
Héctor Ramón Jiménez 2025-02-02 17:50:12 +01:00
parent 7db5256b72
commit 0c6d4eb23f
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
3 changed files with 17 additions and 23 deletions

View file

@ -338,7 +338,7 @@ where
let text_bounds = bounds.shrink(self.padding);
let translation = text_bounds.position() - Point::ORIGIN;
if let Some(_) = state.focus.as_ref() {
if state.focus.is_some() {
let position = match internal.editor.cursor() {
Cursor::Caret(position) => position,
Cursor::Selection(ranges) => ranges
@ -872,10 +872,11 @@ where
};
shell.update_caret_info(if state.is_focused() {
let rect = self
.caret_rect(tree, renderer, layout)
.unwrap_or(Rectangle::default());
let rect =
self.caret_rect(tree, renderer, layout).unwrap_or_default();
let bottom_left = Point::new(rect.x, rect.y + rect.height);
Some(CaretInfo {
position: bottom_left,
input_method_allowed: true,