Skip to content

Commit edb99ab

Browse files
authored
fix(editor): treat missing write capability as editable (#2853)
* fix(editor): treat missing write capability as editable * fix
1 parent aa62e83 commit edb99ab

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/lib/openFile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export default async function openFile(file, options = {}) {
117117
const fs = fsOperation(uri);
118118
const fileInfo = await fs.stat();
119119
const name = fileInfo.name || file.filename || uri;
120-
const readOnly = fileInfo.canWrite ? false : true;
120+
const readOnly = fileInfo.canWrite === false;
121121
const createEditor = (isUnsaved, text, detectedEncoding) => {
122122
new EditorFile(name, {
123123
uri,

src/sidebarApps/searchInFiles/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ async function onWorkerMessage(e) {
377377
startedWorkers.reduce((acc, { progress = 0 }) => acc + progress, 0) /
378378
startedWorkers.length,
379379
);
380-
$progress.value = progress;
380+
$progress.value = Math.min(progress, 99);
381381
break;
382382
}
383383

@@ -538,6 +538,7 @@ async function finishSearchTask(version = searchVersion) {
538538
searchResult.setGhostText(strings["no result"], { row: 0, column: 0 });
539539
}
540540

541+
$progress.value = 100;
541542
searching = false;
542543
nativeSearchId = null;
543544
$indexStatus.value = "";
@@ -773,7 +774,7 @@ function sendNativeSearch(
773774
$indexStatus.value = event.message || "";
774775
break;
775776
case "progress":
776-
$progress.value = event.data || 0;
777+
$progress.value = Math.min(event.data || 0, 99);
777778
break;
778779
case "search-result":
779780
appendSearchResult(event.data);

0 commit comments

Comments
 (0)