dsh-gufa-code 1.3.63 → 1.3.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/client.js +259 -133
- package/desktop/float/bin/gufa-float-macos-arm64 +0 -0
- package/desktop/float/bin/gufa-float-macos-universal +0 -0
- package/desktop/float/bin/gufa-float-macos-x64 +0 -0
- package/desktop/float//345/217/244/346/263/225/347/274/226/347/250/213/346/202/254/346/265/256/345/261/202.app/Contents/Info.plist +2 -2
- package/desktop/float//345/217/244/346/263/225/347/274/226/347/250/213/346/202/254/346/265/256/345/261/202.app/Contents/MacOS/gufa-float +0 -0
- package/host/fs.js +167 -6
- package/package.json +1 -1
- package/scripts/selftest-host.mjs +24 -0
- package/src/client/00-core.js +37 -22
- package/src/client/50-panels.js +218 -79
- package/src/client/90-app.js +3 -31
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
<key>CFBundleDisplayName</key><string>古法编程悬浮层</string>
|
|
8
8
|
<key>CFBundleExecutable</key><string>gufa-float</string>
|
|
9
9
|
<key>CFBundlePackageType</key><string>APPL</string>
|
|
10
|
-
<key>CFBundleShortVersionString</key><string>1.3.
|
|
11
|
-
<key>CFBundleVersion</key><string>1.3.
|
|
10
|
+
<key>CFBundleShortVersionString</key><string>1.3.65</string>
|
|
11
|
+
<key>CFBundleVersion</key><string>1.3.65</string>
|
|
12
12
|
<key>LSUIElement</key><true/>
|
|
13
13
|
<key>NSHighResolutionCapable</key><true/>
|
|
14
14
|
<key>NSPrincipalClass</key><string>NSApplication</string>
|
|
Binary file
|
package/host/fs.js
CHANGED
|
@@ -115,6 +115,70 @@ function searchExtensionOf(rel) {
|
|
|
115
115
|
function escapeRegExp(text) {
|
|
116
116
|
return String(text).replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
|
|
117
117
|
}
|
|
118
|
+
/** 解析「包含/排除的文件」:数组或逗号/换行分隔字符串。 */
|
|
119
|
+
function readPatternList(value) {
|
|
120
|
+
if (Array.isArray(value)) return value.filter((item) => typeof item === 'string').map((item) => item.trim()).filter(Boolean)
|
|
121
|
+
if (typeof value === 'string') return value.split(/[,\n]/).map((item) => item.trim()).filter(Boolean)
|
|
122
|
+
return []
|
|
123
|
+
}
|
|
124
|
+
/** 把 VS Code 风格 glob 编译成正则(支持 **、*、?;无 / 的模式匹配任意层级 basename)。 */
|
|
125
|
+
function globToRegExp(pattern) {
|
|
126
|
+
let text = String(pattern).replace(/\\/g, '/').trim()
|
|
127
|
+
if (text === '') return null
|
|
128
|
+
if (text.startsWith('./')) text = text.slice(2)
|
|
129
|
+
let body = ''
|
|
130
|
+
for (let index = 0; index < text.length; index += 1) {
|
|
131
|
+
const char = text[index]
|
|
132
|
+
if (char === '*') {
|
|
133
|
+
if (text[index + 1] === '*') {
|
|
134
|
+
index += 1
|
|
135
|
+
if (text[index + 1] === '/') {
|
|
136
|
+
index += 1
|
|
137
|
+
body += '(?:.*/)?'
|
|
138
|
+
} else {
|
|
139
|
+
body += '.*'
|
|
140
|
+
}
|
|
141
|
+
} else {
|
|
142
|
+
body += '[^/]*'
|
|
143
|
+
}
|
|
144
|
+
continue
|
|
145
|
+
}
|
|
146
|
+
if (char === '?') {
|
|
147
|
+
body += '[^/]'
|
|
148
|
+
continue
|
|
149
|
+
}
|
|
150
|
+
body += char.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
|
|
151
|
+
}
|
|
152
|
+
const hasSlash = text.includes('/')
|
|
153
|
+
const anchored = text.startsWith('/') ? `^/${body}$` : hasSlash ? `^${body}$` : `(?:^|/)${body}$`
|
|
154
|
+
try {
|
|
155
|
+
return new RegExp(anchored, 'i')
|
|
156
|
+
} catch {
|
|
157
|
+
return null
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
/** 构造路径过滤器:include 任一命中 + 不被 exclude 命中。 */
|
|
161
|
+
function buildPathFilter(options) {
|
|
162
|
+
const include = readPatternList(options.include).map(globToRegExp).filter(Boolean)
|
|
163
|
+
const exclude = readPatternList(options.exclude).map(globToRegExp).filter(Boolean)
|
|
164
|
+
return (rel) => {
|
|
165
|
+
if (include.length > 0 && !include.some((regex) => regex.test(rel))) return false
|
|
166
|
+
if (exclude.length > 0 && exclude.some((regex) => regex.test(rel))) return false
|
|
167
|
+
return true
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
/** VS Code 式「保留大小写」:全大写/全小写/首字母大写分别跟随匹配项。 */
|
|
171
|
+
function applyPreserveCase(matched, replacement) {
|
|
172
|
+
const text = String(matched ?? '')
|
|
173
|
+
if (text === '' || replacement === '') return replacement
|
|
174
|
+
const upper = text === text.toUpperCase() && text !== text.toLowerCase()
|
|
175
|
+
const lower = text === text.toLowerCase() && text !== text.toUpperCase()
|
|
176
|
+
if (upper) return replacement.toUpperCase()
|
|
177
|
+
if (lower) return replacement.toLowerCase()
|
|
178
|
+
if (/^[A-Z]/.test(text)) return replacement.charAt(0).toUpperCase() + replacement.slice(1)
|
|
179
|
+
return replacement
|
|
180
|
+
}
|
|
181
|
+
|
|
118
182
|
async function isGitProject(root, project) {
|
|
119
183
|
if (project !== null && project !== undefined && project.isGit === true) return true
|
|
120
184
|
try {
|
|
@@ -342,6 +406,7 @@ export function register(router, env) {
|
|
|
342
406
|
const options = body.options !== null && typeof body.options === 'object' ? body.options : {}
|
|
343
407
|
const caseSensitive = options.caseSensitive === true
|
|
344
408
|
const useRegex = options.regex === true
|
|
409
|
+
const pathFilter = buildPathFilter(options)
|
|
345
410
|
const clampInt = (value, fallback, min, max) => {
|
|
346
411
|
const number = Number(value)
|
|
347
412
|
if (!Number.isFinite(number)) return fallback
|
|
@@ -442,6 +507,7 @@ export function register(router, env) {
|
|
|
442
507
|
return matches
|
|
443
508
|
}
|
|
444
509
|
const acceptFile = async (rel) => {
|
|
510
|
+
if (!pathFilter(rel)) return
|
|
445
511
|
const matches = await searchFile(rel)
|
|
446
512
|
if (matches.length === 0) return
|
|
447
513
|
files.push({ path: rel, matches })
|
|
@@ -530,10 +596,11 @@ export function register(router, env) {
|
|
|
530
596
|
const root = project.root
|
|
531
597
|
const query = typeof body.query === 'string' ? body.query.slice(0, 200) : ''
|
|
532
598
|
const replacement = typeof body.replacement === 'string' ? body.replacement : ''
|
|
533
|
-
if (query === '') return { replacedFiles: [], replacedCount: 0, failed: [], scanned: 0, truncated: false }
|
|
599
|
+
if (query === '') return { replacedFiles: [], replacedCount: 0, failed: [], scanned: 0, truncated: false, stale: false }
|
|
534
600
|
const options = body.options !== null && typeof body.options === 'object' ? body.options : {}
|
|
535
601
|
const caseSensitive = options.caseSensitive === true
|
|
536
602
|
const useRegex = options.regex === true
|
|
603
|
+
const preserveCase = options.preserveCase === true
|
|
537
604
|
const clampInt = (value, fallback, min, max) => {
|
|
538
605
|
const number = Number(value)
|
|
539
606
|
if (!Number.isFinite(number)) return fallback
|
|
@@ -550,6 +617,85 @@ export function register(router, env) {
|
|
|
550
617
|
if (useRegex && new RegExp(query, caseSensitive ? '' : 'i').test('')) {
|
|
551
618
|
throw new ApiError('bad-regex', '正则表达式不能匹配空字符串', 400)
|
|
552
619
|
}
|
|
620
|
+
const fileSizeLimit = 2 * 1024 * 1024
|
|
621
|
+
const pathFilter = buildPathFilter(options)
|
|
622
|
+
|
|
623
|
+
/* 模式 A:只替换某一个匹配(搜索结果行上的替换按钮),用行/列定位。 */
|
|
624
|
+
const target = body.target !== null && typeof body.target === 'object' ? body.target : null
|
|
625
|
+
if (target !== null) {
|
|
626
|
+
const rawPath = typeof target.path === 'string' ? target.path : ''
|
|
627
|
+
const targetLine = Number(target.line)
|
|
628
|
+
const targetColumn = Number(target.column)
|
|
629
|
+
if (rawPath === '' || !Number.isInteger(targetLine) || targetLine < 1 || !Number.isInteger(targetColumn) || targetColumn < 1) {
|
|
630
|
+
throw badRequest('target.line / target.column is required')
|
|
631
|
+
}
|
|
632
|
+
let absolute
|
|
633
|
+
try {
|
|
634
|
+
absolute = await resolveProjectPath(root, rawPath)
|
|
635
|
+
} catch {
|
|
636
|
+
return { replacedFiles: [], replacedCount: 0, failed: [rawPath], scanned: 1, truncated: false, stale: true }
|
|
637
|
+
}
|
|
638
|
+
const info = await stat(absolute).catch(() => undefined)
|
|
639
|
+
if (info === undefined || !info.isFile() || info.size > fileSizeLimit) {
|
|
640
|
+
return { replacedFiles: [], replacedCount: 0, failed: [rawPath], scanned: 1, truncated: false, stale: true }
|
|
641
|
+
}
|
|
642
|
+
let buffer
|
|
643
|
+
try {
|
|
644
|
+
buffer = await readFile(absolute)
|
|
645
|
+
} catch {
|
|
646
|
+
return { replacedFiles: [], replacedCount: 0, failed: [rawPath], scanned: 1, truncated: false, stale: false }
|
|
647
|
+
}
|
|
648
|
+
if (buffer.includes(0)) return { replacedFiles: [], replacedCount: 0, failed: [rawPath], scanned: 1, truncated: false, stale: false }
|
|
649
|
+
const text = buffer.toString('utf8')
|
|
650
|
+
regex.lastIndex = 0
|
|
651
|
+
let found = null
|
|
652
|
+
let cursor = 0
|
|
653
|
+
let line = 1
|
|
654
|
+
let lineStart = 0
|
|
655
|
+
let match
|
|
656
|
+
while ((match = regex.exec(text)) !== null) {
|
|
657
|
+
if (match[0].length === 0) {
|
|
658
|
+
regex.lastIndex += 1
|
|
659
|
+
continue
|
|
660
|
+
}
|
|
661
|
+
const index = match.index
|
|
662
|
+
if (index > cursor) {
|
|
663
|
+
const chunk = text.slice(cursor, index)
|
|
664
|
+
const newlines = chunk.split('\n').length - 1
|
|
665
|
+
line += newlines
|
|
666
|
+
const lastNewline = chunk.lastIndexOf('\n')
|
|
667
|
+
if (lastNewline !== -1) lineStart = cursor + lastNewline + 1
|
|
668
|
+
cursor = index
|
|
669
|
+
}
|
|
670
|
+
const column = index - lineStart + 1
|
|
671
|
+
if (line === targetLine && column === targetColumn) {
|
|
672
|
+
found = { index, value: match[0] }
|
|
673
|
+
break
|
|
674
|
+
}
|
|
675
|
+
if (line > targetLine || (line === targetLine && column > targetColumn)) break
|
|
676
|
+
}
|
|
677
|
+
if (found === null) {
|
|
678
|
+
return { replacedFiles: [], replacedCount: 0, failed: [], scanned: 1, truncated: false, stale: true }
|
|
679
|
+
}
|
|
680
|
+
let replacedValue = replacement
|
|
681
|
+
if (useRegex) {
|
|
682
|
+
try {
|
|
683
|
+
replacedValue = found.value.replace(new RegExp(`^(?:${query})$`, caseSensitive ? '' : 'i'), replacement)
|
|
684
|
+
} catch {
|
|
685
|
+
replacedValue = replacement
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
if (preserveCase) replacedValue = applyPreserveCase(found.value, replacedValue)
|
|
689
|
+
const updated = `${text.slice(0, found.index)}${replacedValue}${text.slice(found.index + found.value.length)}`
|
|
690
|
+
try {
|
|
691
|
+
await writeFile(absolute, updated, 'utf8')
|
|
692
|
+
} catch {
|
|
693
|
+
return { replacedFiles: [], replacedCount: 0, failed: [rawPath], scanned: 1, truncated: false, stale: false }
|
|
694
|
+
}
|
|
695
|
+
return { replacedFiles: [relativePath(root, absolute)], replacedCount: 1, failed: [], scanned: 1, truncated: false, stale: false }
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
/* 模式 B:批量替换(全部替换 / 单个文件替换)。 */
|
|
553
699
|
const pathsFilter = Array.isArray(body.paths)
|
|
554
700
|
? body.paths.filter((item) => typeof item === 'string' && item !== '').slice(0, 200)
|
|
555
701
|
: null
|
|
@@ -558,20 +704,35 @@ export function register(router, env) {
|
|
|
558
704
|
for (const raw of pathsFilter) {
|
|
559
705
|
try {
|
|
560
706
|
const absolute = await resolveProjectPath(root, raw)
|
|
561
|
-
|
|
707
|
+
const rel = relativePath(root, absolute)
|
|
708
|
+
if (pathFilter(rel)) candidates.push(rel)
|
|
562
709
|
} catch {
|
|
563
710
|
/* 路径非法/已删除:跳过 */
|
|
564
711
|
}
|
|
565
712
|
}
|
|
566
713
|
} else {
|
|
567
714
|
const listed = await listProjectCandidates(root, project, 20000)
|
|
568
|
-
candidates = listed.files
|
|
715
|
+
candidates = listed.files.filter((rel) => pathFilter(rel))
|
|
569
716
|
}
|
|
570
|
-
const fileSizeLimit = 2 * 1024 * 1024
|
|
571
717
|
const replacedFiles = []
|
|
572
718
|
const failed = []
|
|
573
719
|
let replacedCount = 0
|
|
574
720
|
let truncated = false
|
|
721
|
+
const expand = (matched, groups) => {
|
|
722
|
+
let output = replacement
|
|
723
|
+
if (useRegex) {
|
|
724
|
+
output = output
|
|
725
|
+
.replace(/\$\$/g, '\u0000')
|
|
726
|
+
.replace(/\$&/g, matched)
|
|
727
|
+
.replace(/\$(\d{1,2})/g, (piece, index) => {
|
|
728
|
+
const group = groups[Number(index) - 1]
|
|
729
|
+
return group === undefined ? piece : group
|
|
730
|
+
})
|
|
731
|
+
.replace(/\u0000/g, '$')
|
|
732
|
+
}
|
|
733
|
+
if (preserveCase) output = applyPreserveCase(matched, output)
|
|
734
|
+
return output
|
|
735
|
+
}
|
|
575
736
|
for (const rel of candidates) {
|
|
576
737
|
if (replacedCount >= maxReplacements) {
|
|
577
738
|
truncated = true
|
|
@@ -598,7 +759,7 @@ export function register(router, env) {
|
|
|
598
759
|
}
|
|
599
760
|
let updated
|
|
600
761
|
try {
|
|
601
|
-
updated = text.replace(regex,
|
|
762
|
+
updated = text.replace(regex, (matched, ...args) => expand(matched, args.slice(0, Math.max(args.length - 2, 0))))
|
|
602
763
|
} catch (error) {
|
|
603
764
|
failed.push(rel)
|
|
604
765
|
continue
|
|
@@ -612,7 +773,7 @@ export function register(router, env) {
|
|
|
612
773
|
failed.push(rel)
|
|
613
774
|
}
|
|
614
775
|
}
|
|
615
|
-
return { replacedFiles, replacedCount, failed, scanned: candidates.length, truncated }
|
|
776
|
+
return { replacedFiles, replacedCount, failed, scanned: candidates.length, truncated, stale: false }
|
|
616
777
|
})
|
|
617
778
|
|
|
618
779
|
router.method('fs.matchFiles', async (body) => {
|
package/package.json
CHANGED
|
@@ -184,6 +184,30 @@ try {
|
|
|
184
184
|
emptyRegexRejected = error.code === 'bad-regex'
|
|
185
185
|
}
|
|
186
186
|
check('replace rejects empty-matching regex', emptyRegexRejected)
|
|
187
|
+
await call(router, 'fs.write', { root, path: 'replace.txt', content: 'foo FOO Foo\n', expectedRevision: dollarDoc.revision })
|
|
188
|
+
const cased = await call(router, 'fs.replace', { root, query: 'foo', replacement: 'bar', options: { preserveCase: true }, paths: ['replace.txt'] })
|
|
189
|
+
const casedDoc = await call(router, 'fs.read', { root, path: 'replace.txt' })
|
|
190
|
+
check('replace preserve case', cased.replacedCount === 3 && casedDoc.content === 'bar BAR Bar\n', JSON.stringify(casedDoc.content))
|
|
191
|
+
await call(router, 'fs.write', { root, path: 'replace.txt', content: 'one two two\n', expectedRevision: casedDoc.revision })
|
|
192
|
+
const single = await call(router, 'fs.replace', { root, query: 'two', replacement: 'X', target: { path: 'replace.txt', line: 1, column: 5 } })
|
|
193
|
+
const singleDoc = await call(router, 'fs.read', { root, path: 'replace.txt' })
|
|
194
|
+
check('replace single match by line/column', single.replacedCount === 1 && singleDoc.content === 'one X two\n', JSON.stringify(singleDoc.content))
|
|
195
|
+
const stale = await call(router, 'fs.replace', { root, query: 'two', replacement: 'Y', target: { path: 'replace.txt', line: 1, column: 50 } })
|
|
196
|
+
check('replace single stale target', stale.replacedCount === 0 && stale.stale === true)
|
|
197
|
+
await call(router, 'fs.create', { root, path: 'inc.md', kind: 'file' })
|
|
198
|
+
await call(router, 'fs.create', { root, path: 'inc.txt', kind: 'file' })
|
|
199
|
+
await call(router, 'fs.write', { root, path: 'inc.md', content: 'ZzIncToken here\n' })
|
|
200
|
+
await call(router, 'fs.write', { root, path: 'inc.txt', content: 'ZzIncToken here\n' })
|
|
201
|
+
const includeSearch = await call(router, 'fs.search', { root, query: 'ZzIncToken', options: { include: '*.md' } })
|
|
202
|
+
check('search include filter', includeSearch.files.length === 1 && includeSearch.files[0].path === 'inc.md', JSON.stringify(includeSearch.files.map((file) => file.path)))
|
|
203
|
+
const excludeSearch = await call(router, 'fs.search', { root, query: 'ZzIncToken', options: { exclude: '*.md' } })
|
|
204
|
+
check('search exclude filter', excludeSearch.files.length === 1 && excludeSearch.files[0].path === 'inc.txt', JSON.stringify(excludeSearch.files.map((file) => file.path)))
|
|
205
|
+
const includeReplace = await call(router, 'fs.replace', { root, query: 'ZzIncToken', replacement: 'Included', options: { include: '*.md' } })
|
|
206
|
+
const incMd = await call(router, 'fs.read', { root, path: 'inc.md' })
|
|
207
|
+
const incTxt = await call(router, 'fs.read', { root, path: 'inc.txt' })
|
|
208
|
+
check('replace include filter', includeReplace.replacedCount === 1 && incMd.content === 'Included here\n' && incTxt.content === 'ZzIncToken here\n', JSON.stringify([incMd.content, incTxt.content]))
|
|
209
|
+
await call(router, 'fs.delete', { root, path: 'inc.md' })
|
|
210
|
+
await call(router, 'fs.delete', { root, path: 'inc.txt' })
|
|
187
211
|
await call(router, 'fs.delete', { root, path: 'replace.txt' })
|
|
188
212
|
writeFileSync(join(projectDir, 'src/main.ts'), 'const answer = 43\n')
|
|
189
213
|
const diff = await call(router, 'git.diff', { root, path: 'src/main.ts' })
|
package/src/client/00-core.js
CHANGED
|
@@ -191,15 +191,23 @@ const DICT_ZH = {
|
|
|
191
191
|
'search.searching': '搜索中…',
|
|
192
192
|
'search.idle': '输入关键字搜索整个项目',
|
|
193
193
|
'search.noResult': '没有找到匹配结果',
|
|
194
|
-
'search.summary': '{
|
|
194
|
+
'search.summary': '{files} 个文件中有 {count} 个结果',
|
|
195
195
|
'search.truncated': '结果过多已截断,请缩小范围',
|
|
196
196
|
'search.error': '搜索失败',
|
|
197
197
|
'search.replaceToggle': '显示/隐藏替换',
|
|
198
|
+
'search.include': '包含的文件',
|
|
199
|
+
'search.exclude': '排除的文件',
|
|
200
|
+
'search.includePlaceholder': '例如 *.js, src/**',
|
|
201
|
+
'search.excludePlaceholder': '例如 **/*.min.js, test/**',
|
|
202
|
+
'search.preserveCase': '保留大小写(AB)',
|
|
203
|
+
'search.replaceOne': '替换此匹配',
|
|
204
|
+
'search.dismiss': '忽略此匹配',
|
|
205
|
+
'search.openInEditor': '在编辑器中打开',
|
|
206
|
+
'search.stale': '匹配位置已变化,已重新搜索',
|
|
198
207
|
'search.replacePlaceholder': '替换为…',
|
|
199
208
|
'search.replaceAll': '全部替换',
|
|
200
209
|
'search.replaceThisFile': '替换此文件',
|
|
201
210
|
'search.replacing': '替换中…',
|
|
202
|
-
'search.replaced': '已替换 {count} 处({files} 个文件)',
|
|
203
211
|
'search.confirmReplace': '确定替换 {count} 处({files} 个文件)?直接写文件,编辑器撤销无效。',
|
|
204
212
|
'search.confirmYes': '确定替换',
|
|
205
213
|
'search.confirmNo': '取消',
|
|
@@ -240,11 +248,9 @@ const DICT_ZH = {
|
|
|
240
248
|
'git.behindCount': '待拉取',
|
|
241
249
|
'git.pull': '拉取',
|
|
242
250
|
'git.noUpstreamHint': '当前分支还没有上游:点标题栏 ↑ 推送一次即可自动创建上游(git push -u)',
|
|
243
|
-
'git.pushDone': '已推送(如需首次建立上游会自动 -u)',
|
|
244
251
|
'git.discardFile': '还原该文件的改动',
|
|
245
252
|
'git.autoStageHint': '提交时会自动暂存所有未暂存改动(也可以先手动选择要暂存的文件)',
|
|
246
253
|
'git.commitNeedsMessage': '请先填写提交信息,再按 ⌘⇧↵ 提交',
|
|
247
|
-
'git.commitDone': '提交成功',
|
|
248
254
|
'git.more': '更多操作',
|
|
249
255
|
'git.viewDiff': '查看改动对比',
|
|
250
256
|
'git.copyPath': '复制文件路径',
|
|
@@ -272,8 +278,6 @@ const DICT_ZH = {
|
|
|
272
278
|
'diff.stageFile': '暂存文件',
|
|
273
279
|
'git.discardAll': '撤销所有未暂存改动',
|
|
274
280
|
'git.discardConfirm': '再点一次确认撤销(未跟踪文件不会被删除)',
|
|
275
|
-
'git.discardDone': '已撤销所有改动(未跟踪文件保留)',
|
|
276
|
-
'git.pullDone': '拉取完成',
|
|
277
281
|
'git.committed': '已提交',
|
|
278
282
|
'git.refresh': '刷新',
|
|
279
283
|
'git.staged': '已暂存',
|
|
@@ -433,15 +437,23 @@ const DICT_EN = {
|
|
|
433
437
|
'search.searching': 'Searching…',
|
|
434
438
|
'search.idle': 'Type a keyword to search the whole project',
|
|
435
439
|
'search.noResult': 'No matches found',
|
|
436
|
-
'search.summary': '{count} results
|
|
440
|
+
'search.summary': '{count} results in {files} files',
|
|
437
441
|
'search.truncated': 'Too many results, truncated — narrow the query',
|
|
438
442
|
'search.error': 'Search failed',
|
|
439
443
|
'search.replaceToggle': 'Show / hide replace',
|
|
444
|
+
'search.include': 'files to include',
|
|
445
|
+
'search.exclude': 'files to exclude',
|
|
446
|
+
'search.includePlaceholder': 'e.g. *.js, src/**',
|
|
447
|
+
'search.excludePlaceholder': 'e.g. **/*.min.js, test/**',
|
|
448
|
+
'search.preserveCase': 'Preserve case (AB)',
|
|
449
|
+
'search.replaceOne': 'Replace this match',
|
|
450
|
+
'search.dismiss': 'Dismiss this match',
|
|
451
|
+
'search.openInEditor': 'Open in editor',
|
|
452
|
+
'search.stale': 'Match moved; search refreshed',
|
|
440
453
|
'search.replacePlaceholder': 'Replace with…',
|
|
441
454
|
'search.replaceAll': 'Replace all',
|
|
442
455
|
'search.replaceThisFile': 'Replace in this file',
|
|
443
456
|
'search.replacing': 'Replacing…',
|
|
444
|
-
'search.replaced': 'Replaced {count} occurrences ({files} files)',
|
|
445
457
|
'search.confirmReplace': 'Replace {count} occurrences in {files} files? This writes files directly; editor undo will not work.',
|
|
446
458
|
'search.confirmYes': 'Replace',
|
|
447
459
|
'search.confirmNo': 'Cancel',
|
|
@@ -482,11 +494,9 @@ const DICT_EN = {
|
|
|
482
494
|
'git.behindCount': 'to pull',
|
|
483
495
|
'git.pull': 'Pull',
|
|
484
496
|
'git.noUpstreamHint': 'No upstream for this branch yet: click ↑ in the header to push once (auto git push -u)',
|
|
485
|
-
'git.pushDone': 'Pushed',
|
|
486
497
|
'git.discardFile': 'Revert this file',
|
|
487
498
|
'git.autoStageHint': 'Committing auto-stages all unstaged changes',
|
|
488
499
|
'git.commitNeedsMessage': 'Write a commit message first, then press ⌘⇧↵',
|
|
489
|
-
'git.commitDone': 'Committed',
|
|
490
500
|
'git.more': 'More actions',
|
|
491
501
|
'git.viewDiff': 'View diff',
|
|
492
502
|
'git.copyPath': 'Copy file path',
|
|
@@ -514,8 +524,6 @@ const DICT_EN = {
|
|
|
514
524
|
'diff.stageFile': 'Stage file',
|
|
515
525
|
'git.discardAll': 'Discard all unstaged changes',
|
|
516
526
|
'git.discardConfirm': 'Click again to confirm (untracked files are kept)',
|
|
517
|
-
'git.discardDone': 'All changes discarded (untracked files kept)',
|
|
518
|
-
'git.pullDone': 'Pull complete',
|
|
519
527
|
'git.committed': 'Committed',
|
|
520
528
|
'git.refresh': 'Refresh',
|
|
521
529
|
'git.staged': 'Staged',
|
|
@@ -1725,10 +1733,26 @@ html[data-platform=darwin][data-fullscreen] .gufa-titlebar{height:44px;padding-l
|
|
|
1725
1733
|
.gufa-search-action[data-primary]{background:var(--gufa-accent);border-color:var(--gufa-accent);color:#fff}
|
|
1726
1734
|
.gufa-search-confirm{margin:6px 8px 0;padding:7px 9px;border-radius:7px;border:1px solid var(--gufa-accent);background:color-mix(in srgb, var(--gufa-accent) 12%, transparent);font-size:11.5px;line-height:1.55;color:var(--gufa-text)}
|
|
1727
1735
|
.gufa-search-confirm-actions{display:flex;justify-content:flex-end;gap:6px;margin-top:6px}
|
|
1728
|
-
.gufa-search-notice{margin:6px 8px 0;padding:5px 9px;border-radius:7px;font-size:11.5px;color:var(--dsw-alias-state-success-primary);border:1px solid color-mix(in srgb, var(--dsw-alias-state-success-primary) 45%, transparent)}
|
|
1729
1736
|
.gufa-search-error{margin:6px 8px 0;padding:5px 9px;border-radius:7px;font-size:11.5px;color:var(--dsw-alias-state-error-primary);border:1px solid color-mix(in srgb, var(--dsw-alias-state-error-primary) 45%, transparent)}
|
|
1730
1737
|
.gufa-search-file-replace{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;margin-left:2px;border-radius:4px;color:var(--gufa-text-dim);cursor:pointer}
|
|
1731
1738
|
.gufa-search-file-replace:hover{background:var(--gufa-active);color:var(--gufa-text)}
|
|
1739
|
+
.gufa-search-file-replace{opacity:0;transition:opacity .12s ease}
|
|
1740
|
+
.gufa-search-file-head:hover .gufa-search-file-replace,.gufa-search-file-head:focus-within .gufa-search-file-replace{opacity:1}
|
|
1741
|
+
.gufa-search-match{min-height:23px;align-items:center}
|
|
1742
|
+
.gufa-search-match-actions{display:none;flex:0 0 auto;align-items:center;gap:4px;margin-left:auto}
|
|
1743
|
+
.gufa-search-match:hover .gufa-search-match-actions,.gufa-search-match:focus-within .gufa-search-match-actions{display:flex}
|
|
1744
|
+
.gufa-search-row-action{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:4px;color:var(--gufa-text-dim);cursor:pointer}
|
|
1745
|
+
.gufa-search-row-action:hover{background:var(--gufa-active);color:var(--gufa-text)}
|
|
1746
|
+
.gufa-search-filter{display:flex;flex-direction:column;gap:3px;margin-top:5px}
|
|
1747
|
+
.gufa-search-filter-label{font-size:10.5px;color:var(--gufa-text-dim)}
|
|
1748
|
+
.gufa-search-filter-input{width:100%;height:24px;padding:0 8px;border-radius:6px;border:1px solid var(--gufa-border);background:var(--gufa-layer2);color:var(--gufa-text);font-size:11.5px;outline:none}
|
|
1749
|
+
.gufa-search-filter-input:focus{border-color:var(--gufa-accent)}
|
|
1750
|
+
.gufa-search-filter-input::placeholder{color:var(--gufa-text-dim)}
|
|
1751
|
+
.gufa-search-summarybar{display:flex;align-items:center;gap:8px}
|
|
1752
|
+
.gufa-search-summarybar .gufa-search-summary{flex:1 1 auto;margin-left:0}
|
|
1753
|
+
.gufa-search-summarybar .gufa-search-link{flex:0 0 auto}
|
|
1754
|
+
.gufa-search-link{border:0;background:transparent;color:var(--gufa-accent);font-size:11px;cursor:pointer;padding:0}
|
|
1755
|
+
.gufa-search-link:hover{text-decoration:underline}
|
|
1732
1756
|
|
|
1733
1757
|
.gufa-tree-chevron{width:14px;flex:0 0 auto;opacity:.7;display:flex;align-items:center;justify-content:center}
|
|
1734
1758
|
.gufa-tree-icon{width:15px;flex:0 0 auto;opacity:.85;display:flex;align-items:center;justify-content:center}
|
|
@@ -1846,15 +1870,6 @@ html[data-gufa-ide] .liang-skin-backdrop{display:none!important}
|
|
|
1846
1870
|
.gufa-git-sync[data-active]{color:var(--gufa-accent)}
|
|
1847
1871
|
.gufa-git-sync-count{font-size:10.5px;font-variant-numeric:tabular-nums;min-width:8px;text-align:center}
|
|
1848
1872
|
.gufa-git-sync[data-active] .gufa-git-sync-count{font-weight:700}
|
|
1849
|
-
.gufa-info-banner{display:flex;align-items:center;gap:6px;margin:8px 10px 0;padding:4px 8px;border-radius:6px;font-size:11.5px;
|
|
1850
|
-
color:var(--dsw-alias-state-success-primary, #3fa66f);border:1px solid color-mix(in srgb, currentColor 35%, transparent);
|
|
1851
|
-
background:color-mix(in srgb, currentColor 10%, transparent)}
|
|
1852
|
-
.gufa-toast-success{position:fixed;top:14px;left:50%;transform:translateX(-50%);z-index:2147483300;
|
|
1853
|
-
display:flex;align-items:center;gap:6px;padding:6px 14px;border-radius:999px;font-size:12px;pointer-events:none;
|
|
1854
|
-
color:var(--dsw-alias-state-success-primary, #3fb950);
|
|
1855
|
-
background:color-mix(in srgb, #3fb950 16%, var(--gufa-solid-overlay-bg, #1c1c1c));
|
|
1856
|
-
border:1px solid color-mix(in srgb, #3fb950 50%, transparent);
|
|
1857
|
-
box-shadow:0 8px 24px rgba(0,0,0,.35);backdrop-filter:blur(8px)}
|
|
1858
1873
|
/* 资源管理器:Git 改动状态颜色(M/A/D/R/??) */
|
|
1859
1874
|
.gufa-tree-row[data-git-status="M"] .gufa-tree-name{color:#e5c07b}
|
|
1860
1875
|
.gufa-tree-row[data-git-status="A"] .gufa-tree-name{color:#3fb950}
|