mirror of
https://github.com/ilyakooo0/vty.git
synced 2024-11-25 19:22:08 +03:00
Cursor: add PositionOnly constructor for cursor placement without visibility
This commit is contained in:
parent
6fead08444
commit
fd90f7dc85
@ -207,6 +207,12 @@ outputPicture dc pic = do
|
||||
AbsoluteCursor x y ->
|
||||
writeShowCursor dc `mappend`
|
||||
writeMoveCursor dc (clampX x) (clampY y)
|
||||
PositionOnly isAbs x y ->
|
||||
if isAbs
|
||||
then writeMoveCursor dc (clampX x) (clampY y)
|
||||
else let (ox, oy) = charToOutputPos m (clampX x, clampY y)
|
||||
m = cursorOutputMap ops $ picCursor pic
|
||||
in writeMoveCursor dc (clampX ox) (clampY oy)
|
||||
Cursor x y ->
|
||||
let m = cursorOutputMap ops $ picCursor pic
|
||||
(ox, oy) = charToOutputPos m (clampX x, clampY y)
|
||||
|
@ -82,6 +82,14 @@ data Cursor =
|
||||
NoCursor
|
||||
-- | Show the cursor at the given logical column accounting for
|
||||
-- character width in the presence of multi-column characters.
|
||||
| PositionOnly !Bool !Int !Int
|
||||
-- | Set the terminal's cursor position without displaying a cursor
|
||||
-- character. This is important for accessibility with screen
|
||||
-- readers where a cursor position needs to be reported but we may
|
||||
-- not want to show a block cursor in that location for cosmetic
|
||||
-- reasons. The boolean argument indicates whether the positioning
|
||||
-- should be absolute as with 'AbsoluteCursor' ('True') or logical
|
||||
-- as with 'Cursor' ('False').
|
||||
| Cursor !Int !Int
|
||||
-- | Show the cursor at the given absolute terminal column and row
|
||||
| AbsoluteCursor !Int !Int
|
||||
|
Loading…
Reference in New Issue
Block a user