(v0.8.2) Guardrails

Ever had a file change under you — a git checkout, a quick edit in another app, a script rewriting your .bib — and wondered whether the editor was still showing the truth? texspark now watches your open files, flags a tab the moment its file changes on disk, and asks the right question before any save, reload, or build could quietly clobber one side or the other.

  • External-change detection. Every open tab is watched. When a file changes on disk outside texspark, the tab gets an orange badge — a heads-up, never a surprise auto-reload.
  • Reload on demand. Pull the disk version back in from the button in the editor header, or right-click a tab → Reload from Disk.
  • Conflict-aware save, reload & build. Each action knows whether the tab has unsaved edits and whether the file changed on disk, and offers exactly the choices that make sense — never silently losing either version. Full behavior below.
  • Safer defaults. “Confirm before overwriting” is locked on and background auto-save is locked off while texspark is in active development.

Legend: Unsaved edits = the tab differs from what texspark last saved. Changed on disk = the file was modified outside texspark since then.

Save (⌘S)

Unsaved editsChanged on diskWhat happens
NoNoNothing to save — no-op
NoYesAsks: Reload from Disk / Overwrite with Editor’s Contents / Cancel
YesNoAsks: Overwrite / Cancel, then writes
YesYesAsks: Overwrite / Discard / Discard & Reload / Cancel

Reload from Disk (editor header ↻ · tab menu)

Unsaved editsChanged on diskWhat happens
NoNoReloads (identical — no visible change)
NoYesReloads the disk version immediately
YesNoAsks: Discard & Reload / Cancel
YesYesAsks: Discard & Reload / Cancel

Build (⌘B)

Unsaved editsChanged on diskWhat happens
NoNoBuilds straight away
NoYesAsks: Build with Editor’s Contents / Reload from Disk & Build / Cancel
YesNoAsks: Overwrite / Cancel, then builds
YesYesAsks: Build with Editor’s Contents / Reload from Disk & Build / Cancel

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *