Menu

#4059 Untitled buffer not isUntitled()

normal bug
closed-fixed
None
5
2018-02-16
2018-01-06
Makarius
No

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
  • setup Console plugin and open BeanShell REPL
  • check buffer.isUntitled(): should be true
  • shutdown jEdit and restart (will save perspective.xml)
  • check buffer.isUntitled(): should be still true
  • change property restore=false (e.g. via menu "Utilities / Global Options / General / Restore previously open files on startup")
  • shutdown jEdit and restart
  • check buffer.isUntitled(): FALSE
  • shutdown jEdit
  • rm $HOME/.jedit-test/perspective.xml
  • restart jEdit
  • check buffer.isUntitled(): should be true

After another shutdown and restart, there is a new perspective.xml and consequently the buffer.isUntitled() again false.

Discussion

  • Makarius

    Makarius - 2018-01-06
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -8,7 +8,7 @@
     * `jedit -settings=$HOME/.jedit-test`
     * setup Console plugin and open BeanShell REPL
     * check `buffer.isUntitled()`: should be true
    -* shutdown jEdit and restart (will save perspecive.xml)
    +* shutdown jEdit and restart (will save perspective.xml)
     * check `buffer.isUntitled()`: should be still true
     * change property `restore=false` (e.g. via menu "Utilities / Global Options / General / Restore previously open files on startup")
     * shutdown jEdit and restart
    
     
  • Alan Ezust

    Alan Ezust - 2018-01-06
    • assigned_to: Alan Ezust --> Hrotkó Gábor
     
  • Alan Ezust

    Alan Ezust - 2018-01-06

    Hrotkó Gábor, can you please fix this? I want to get this fixed in jEdit before the next release.

     
  • Hrotkó Gábor

    Hrotkó Gábor - 2018-01-09

    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.

     
    • Alan Ezust

      Alan Ezust - 2018-01-10

      Committed revision 24814.
      Please test tomorrow's daily build, Makarius.

       
  • Makarius

    Makarius - 2018-01-12

    I have used 24816 over 1 day and it looks fine so far.

     
  • Alan Ezust

    Alan Ezust - 2018-02-16
    • status: open --> closed-fixed
     
  • Alan Ezust

    Alan Ezust - 2018-02-16

    thanks makarius and hrotko

     

Log in to post a comment.