Skip to content

Commit

Permalink
Remove linked list part 15
Browse files Browse the repository at this point in the history
  • Loading branch information
Nowely committed Jan 1, 2024
1 parent b6bf44e commit 79794d8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/features/useFocusRecovery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ export const useFocusRecovery = () => {
const {anchor, caret, isNext} = store.recovery

switch (true) {
case !anchor.target:
store.focus.head.focus()
case isNext && !anchor.target:
store.focus.tail.focus()
break
case isNext:
anchor.prev.focus()
break
case !anchor.target:
store.focus.head.focus()
break
default:
anchor.next.focus()
}
Expand Down
13 changes: 13 additions & 0 deletions lib/utils/functions/getTokensByValue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,25 @@ export function getTokensByValue(store: Store) {
const tokens2 = parseUnionLabels(store, updatedIndex)
if (tokens2.length === 1) return store.tokens
return store.tokens.toSpliced(updatedIndex, 1, ...tokens2)
case gap.right !== undefined:
const [updatedIndex2] = getClosestIndexes(ranges, gap.right)
const tokens3 = parseUnionLabels(store, updatedIndex2)
if (tokens3.length === 1) return store.tokens
return store.tokens.toSpliced(updatedIndex2, 1, ...tokens3)
default:
//Parse all string
return Parser.split(value, options)
}
}

type ParseType = '' | 'all'

function identifyParseType(store: Store) {
switch (true) {

}
}

function parseUnionLabels(store: Store, ...indexes: number[]) {
let span = ''
for (const index of indexes) {
Expand Down

0 comments on commit 79794d8

Please sign in to comment.