|
|
@@ -194,10 +194,6 @@ export function resolveZedDbPath() {
|
|
|
return candidates.find((item) => isFile(item))
|
|
|
}
|
|
|
|
|
|
-export function isZedTerminal() {
|
|
|
- return process.env.ZED_TERM === "true" || process.env.TERM_PROGRAM?.toLowerCase() === "zed"
|
|
|
-}
|
|
|
-
|
|
|
function isFile(item: string) {
|
|
|
try {
|
|
|
return statSync(item).isFile()
|
|
|
@@ -220,11 +216,6 @@ function zedWorkspacePaths(value: string | null) {
|
|
|
return value.split(/\r?\n/).filter(Boolean)
|
|
|
}
|
|
|
|
|
|
-export function offsetToPosition(text: string, offset: number) {
|
|
|
- const stringOffset = utf8ByteOffsetToStringIndex(text, offset)
|
|
|
- return offsetsToSelection(text, stringOffset, stringOffset).start
|
|
|
-}
|
|
|
-
|
|
|
function utf8ByteOffsetToStringIndex(text: string, byteOffset: number) {
|
|
|
if (byteOffset <= 0) return 0
|
|
|
|