This is a follow-up to https://sourceforge.net/p/jedit/patches/614 -- the underlying problem is still open.
The problem is that buffers named "Untitled-X" can loose their buffer.isUntitled() status and eventually show up in unexpected places, as if they were regular files (e.g. in the buffer switcher after starting up with plain file arguments).
This is how to reproduce such a bad situation with jEdit trunk 24810 on Linux. The critical point is restore=false
and an existing $JEDIT_SETTINGS/perspectives.xml
: this will re-open an Untitled-1 buffer such that not buffer.isUntitled()
:
rm -rf $HOME/.jedit-test
jedit -settings=$HOME/.jedit-test
buffer.isUntitled()
: should be truebuffer.isUntitled()
: should be still truerestore=false
(e.g. via menu "Utilities / Global Options / General / Restore previously open files on startup")buffer.isUntitled()
: FALSErm $HOME/.jedit-test/perspective.xml
buffer.isUntitled()
: should be trueAfter another shutdown and restart, there is a new perspective.xml and consequently the buffer.isUntitled() again false.
Diff:
Hrotkó Gábor, can you please fix this? I want to get this fixed in jEdit before the next release.
I fixed the isUntitled stuff. After changing the restore property, the path of the untitled buffer will change. I could not fix that, and I think this usecase is not really occurs often.
Committed revision 24814.
Please test tomorrow's daily build, Makarius.
I have used 24816 over 1 day and it looks fine so far.
thanks makarius and hrotko