why does KDevelop auto-close deleted files?

Matthew Woehlke mw_triad at users.sourceforge.net
Fri Sep 26 23:55:09 BST 2014

On 2014-09-26 18:32, Aleix Pol wrote:
> On Fri, Sep 26, 2014 at 9:30 PM, Matthew Woehlke wrote:
>> So I'm working on a project, and realize I need to do some git branch
>> maintenance. I switch branches, do some stuff, switch back... and half
>> of the files I had open in KDevelop are gone.
>> Automatic reloading is bad enough (it drops the undo buffer, which is a
>> form of data loss), but this really is a bit much. Can this be turned
>> off or reverted? (Or is this a katepart issue?)
> This is done in KDevelop side. I would be open to adding a setting for this.

That would be appreciated :-). Automatic reloading was a surprise I
wasn't sure I liked when I first saw it. Automatic closing of files I'm
editing... well, just let's say I'm much less ambivalent as to my
opinion of that "feature". At least, I think there needs to be an option
to prompt before closing files because they vanished (or don't exist) on
disk. (Don't know if I ever mentioned it, but I never liked dropping
files from a working set because they don't exist either.)

> That said, I think that it could make sense to actually fix the issue that
> the undo stack is lost when a file is saved. An approximation to this
> shouldn't be too hard and it would be immensely awesome (also it's done by
> other editors).

I think this is going to be quite difficult. What does it mean to
preserve the undo stack if meanwhile the file has changed radically
outside the editor? (Before automatic reload, I would just tell it to
ignore the external changes until I'm done mucking with things
externally, then tell it to overwrite the file on disk with the copy in
memory. So there isn't an issue.)

Note that taking replacing the in-memory copy with the on-disk copy and
calling that an edit is still lossy... you're still throwing out the
redo part of the stack in that case, and often that was the part I
wanted to preserve.


More information about the KDevelop mailing list