mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2025-07-29 14:00:05 +02:00

* Remove extra padding for off-screen review panel entries * use document.activeElement * cleanup editor padding cases * using isSelectionWithinOp * fix formatting * focusHandler function * 1px border for focused entry * use constants * using isFirstEntry GitOrigin-RevId: 4509f803b6cb907b40f1745a6fc7f3b1edfe145c
10 lines
337 B
TypeScript
10 lines
337 B
TypeScript
import { AnyOperation } from '../../../../../types/change'
|
|
import { SelectionRange } from '@codemirror/state'
|
|
import { visibleTextLength } from '@/utils/operations'
|
|
|
|
export const isSelectionWithinOp = (
|
|
op: AnyOperation,
|
|
range: SelectionRange
|
|
): boolean => {
|
|
return range.to >= op.p && range.from <= op.p + visibleTextLength(op)
|
|
}
|