#3107 Untitled buffer is lost after C+n

closed-fixed
nobody
9
2008-06-04
2008-06-03
Jakub Roztocil
No

When I'm editing an untitled buffer and call File > New, the edited buffer is lost from the buffer list.

jEdit SVN revision 12783

Discussion

  • Logged In: YES
    user_id=285591
    Originator: NO

    Hi, it is fixed in the trunk now, thanks for testing the bufferSet feature

     
    • status: open --> closed-fixed
     
  • Jakub Roztocil
    Jakub Roztocil
    2008-06-04

    Logged In: YES
    user_id=1504176
    Originator: YES

    Thanks for the fix!

    The handling of untitled buffers is still a little strange (probably not bufferSets related issue), though.

    When you close all buffers and have only the default "Untitled-1" buffer opened, then the C+n changes the name of the buffer to "Untitled-2" (3, 4, ...), but in the buffer list is visible only the last one.

    When you save or make the "Untitled-1" buffer dirty, then the New file action always creates new buffer, which also appears in the buffer list.

     
  • Alan Ezust
    Alan Ezust
    2008-06-04

    Logged In: YES
    user_id=935841
    Originator: NO

    if you have an untitled buffer that is not dirty, it must be empty, which means, there is already a new buffer.
    perhaps ctrl-N should do nothing under such a situation?

     
  • Dale Anson
    Dale Anson
    2008-06-05

    Logged In: YES
    user_id=187628
    Originator: NO

    I disagree. Ctrl-N should always make a new buffer. I don't want to hunt in a list for the empty one, if there is one. I'm okay with there being more than one empty, untitled buffer.

     
  • Logged In: YES
    user_id=285591
    Originator: NO

    Before the bufferSet api, here is how jEdit was doing :

    if you have 2 or more buffers, pressing ctrl+N always create a new empty buffer
    if you have 1 buffer, if it is clean and unnamed, it was closed and immediately recreated
    I think there is a reason for that : if you press ctrl+N in another directory it can be a wanted behavior to open a new untitled buffer in that directory to replace the previous one.

    And that's right that pressing ctrl+N when we have only one untitled clean buffer should not change it's number, I will open a new bug in the tracker for that