File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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,
Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments