This commit is contained in:
49lf
2024-11-15 16:35:02 -05:00
parent 2fb16ed074
commit c24efaf2e4
4 changed files with 30 additions and 19 deletions

View File

@ -22,6 +22,8 @@ import usePlatform from 'hooks/usePlatform'
import { FileEntry } from 'lib/project'
import { useFileSystemWatcher } from 'hooks/useFileSystemWatcher'
import { normalizeLineEndings } from 'lib/codeEditor'
import { toSync } from 'lib/utils'
import { reportRejection } from 'lib/trap'
function getIndentationCSS(level: number) {
return `calc(1rem * ${level + 1})`
@ -241,7 +243,7 @@ const FileTreeItem = ({
// Show the renaming form
addCurrentItemToRenaming()
} else if (e.code === 'Space') {
void handleClick()
toSync(handleClick, reportRejection)
}
}
@ -292,7 +294,7 @@ const FileTreeItem = ({
style={{ paddingInlineStart: getIndentationCSS(level) }}
onClick={(e) => {
e.currentTarget.focus()
void handleClick()
toSync(handleClick, reportRejection)
}}
onKeyUp={handleKeyUp}
>