@@ -143,8 +143,9 @@ impl View {
146+ // It is possible for underflow to occur if the buffer length is larger than the terminal width.
146− let row = line - self.first_line as usize;
147+ let row = line.saturating_sub(self.first_line);
147− let col = col - self.first_col as usize;
148+ let col = col.saturating_sub(self.first_col);
149 Some(Position::new(row, col))
150 Some(Position::new(row, col))