mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-17 21:05:04 -04:00
8 lines
321 B
TypeScript
8 lines
321 B
TypeScript
|
import { AnyOperation } from '../../../../../types/change'
|
||
|
import { SelectionRange } from '@codemirror/state'
|
||
|
import { visibleTextLength } from '@/utils/operations'
|
||
|
|
||
|
export const isFocused = (op: AnyOperation, range: SelectionRange): boolean => {
|
||
|
return range.to >= op.p && range.from <= op.p + visibleTextLength(op)
|
||
|
}
|