mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-07 02:51:50 +00:00
fix(tui): track rendered spaces for selection copy
- add a written-cell bitmap so selection can distinguish rendered spaces from blank padding - preserve code indentation without markdown-specific rendering hacks
This commit is contained in:
parent
1735ced93b
commit
bd66e55a02
4 changed files with 57 additions and 28 deletions
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
import { clamp } from './layout/geometry.js'
|
||||
import type { Screen, StylePool } from './screen.js'
|
||||
import { cellAt, cellAtIndex, CellWidth, isEmptyCellAt, setCellStyleId } from './screen.js'
|
||||
import { cellAt, cellAtIndex, CellWidth, isWrittenCellAt, setCellStyleId } from './screen.js'
|
||||
|
||||
type Point = { col: number; row: number }
|
||||
|
||||
|
|
@ -847,7 +847,7 @@ function selectableCell(screen: Screen, row: number, col: number): boolean {
|
|||
|
||||
return (
|
||||
screen.noSelect[row * screen.width + col] !== 1 &&
|
||||
!isEmptyCellAt(screen, col, row) &&
|
||||
isWrittenCellAt(screen, col, row) &&
|
||||
!!cell &&
|
||||
cell.width !== CellWidth.SpacerTail &&
|
||||
cell.width !== CellWidth.SpacerHead
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue