Skip to content

Commit edf9801

Browse files
committed
fix: map file index to correct tab position when saving
1 parent f89bb10 commit edf9801

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/src/main/java/com/itsaky/androidide/activities/editor/EditorHandlerActivity.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,9 @@ open class EditorHandlerActivity :
705705
editorViewModel.areFilesModified = hasUnsaved
706706

707707
// set tab as unmodified
708-
val tab = content.tabs.getTabAt(index) ?: return@withContext
708+
val tabPosition = getTabPositionForFileIndex(index)
709+
if (tabPosition < 0) return@withContext
710+
val tab = content.tabs.getTabAt(tabPosition) ?: return@withContext
709711
val text = tab.text?.toString() ?: return@withContext
710712
if (text.startsWith('*')) {
711713
tab.text = text.substring(1)

0 commit comments

Comments
 (0)