mirror of
https://github.com/lotabout/skim.git
synced 2026-09-10 07:16:23 -04:00
fix(windows): use 1-based cursor position (closes #1065)
This commit is contained in:
parent
19d2640fe1
commit
c3bac9f697
|
|
@ -253,6 +253,7 @@ impl Drop for RawMode {
|
|||
}
|
||||
}
|
||||
|
||||
/// Get cursor position, 1-based
|
||||
#[cfg(unix)]
|
||||
pub(crate) fn cursor_pos_from_tty() -> io::Result<(u16, u16)> {
|
||||
let _guard = RawMode::new()?;
|
||||
|
|
@ -309,10 +310,11 @@ pub(crate) fn cursor_pos_from_tty() -> io::Result<(u16, u16)> {
|
|||
Ok((cx, cy))
|
||||
}
|
||||
|
||||
/// Get cursor position, 1-based
|
||||
#[cfg(windows)]
|
||||
pub(crate) fn cursor_pos_from_tty() -> io::Result<(u16, u16)> {
|
||||
let _guard = RawMode::new()?;
|
||||
crossterm::cursor::position()
|
||||
crossterm::cursor::position().map(|(x, y)| (x + 1, y + 1))
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
|
|||
Loading…
Reference in a new issue