diff options
Diffstat (limited to 'helix-term/src/compositor.rs')
-rw-r--r-- | helix-term/src/compositor.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/helix-term/src/compositor.rs b/helix-term/src/compositor.rs index 3fee1214..59e93e03 100644 --- a/helix-term/src/compositor.rs +++ b/helix-term/src/compositor.rs @@ -120,12 +120,12 @@ impl Compositor { } } - pub fn cursor_position(&self, area: Rect, editor: &Editor) -> Position { + pub fn cursor_position(&self, area: Rect, editor: &Editor) -> Option<Position> { for layer in self.layers.iter().rev() { if let Some(pos) = layer.cursor_position(area, editor) { - return pos; + return Some(pos); } } - panic!("No layer returned a position!"); + None } } |