Sublime Forum

Mini-diff on changes made by other program

#1

Hi,

I use mini_diff set to true, and it works nicely for changes I make in Sublime, but if another program changes the file (which is btw opened in active window) mini diff does not show, it doesn’t register those changes.

Is it somehow possible, to make Sublime show midi diff, when changes are made by another program?

I would guess it uses “.sublime-workspace” file or similar, and it’s not possible…

0 Likes

#2

The mini_diff has a notion of what the base file is supposed to look like, which is either its state in git or the state of the file when it was last opened, and then changes diff against that (hence closing and reopening a file that is not tracked by git clears the indicators).

Based on your description, is the external program modifying the file which is then reloaded in Sublime to see the changes? If so, that would be the reason why they’re not showing.

In theory that is solveable via a plugin of some sort; the API can set what the reference document is, so in theory a plugin could “freeze” the current state of a file and try to maintain it as the last known good version so that if the file reloads differences would show.

Offhand I’m not sure of a package that does that, though.

0 Likes

#3

Thanks

Yes, file was in Sublime active view and while it was modified by agentic cli it was automatically reloaded any time change was made, but w/o mini diff indicators.

I was led by the fact that if I do some edits in Sublime, it will show the mini diff indicators even if the file is saved and not tracked by git. I see the point now - it was not reloaded…

Tracking it under git, it shows the indicators of course.

0 Likes

#4

It made me think about plugin that would allow tracking, then if activated the view would change to RO mode, and changes focus the view on changed lines in real time. That way it could be used even as a tail with following…

It would be beautiful haha <3

0 Likes