Menu

[FEATURE REQ] Exit on close last file

2007-11-22
2012-11-13
  • Nobody/Anonymous

    Could you add such feature like close whole editor after last opened file(tab) is closed.
    Great if this will be optional setting in preferences.

     
    • Philippe Verdy

      Philippe Verdy - 2007-11-24

      Yes of course! It's ridiculous to open a new file when we close all tabs. This should just means the same as exit (notably because when you close a file that was the single one used, the "new" empty file will have no use, but the user won't notice that Notepad++ maintains the current working directory on the location of the last open file: this effectively forbids (for example) deleting the directory where the last file was open.

      Try this:
      * create a new file save it alone in a new directory (this is typically what many softwares are doing when creating log files or temporary files, and it fails, leaving these files for user review).
      * So open this file in notepad++ (this is what you would do to look at the log file or temporary files left by a command that failed to execute: you open it in an editor to see what was wrong, then you try correcting the situation).
      * Then close that file. (you would typically do this after correcting the problem discovered after reviewing the log files or temporary files left by some failing command). Now Notepad++ should no longer have any link to the last open file or its storage directory.
      * Try deleting the directory containing the dummy file and all its content (this is what you would do to cleanup the temporary files or log files left by a failing command: all the files will effectively be deleted as expected, but as long as Notepad++ is running, it won't let you delete the directory because Notepad++ is still using it as its current working directory, and Windows makes sure that the working directory is locked by the process.

      I do think that Notepad++ forgets to remove the directory change listener after it closes the file, and still locks that directory. I do think this is a bug in Notepad++: the editor should not lock things that he no longer uses or needs.

       
    • Don HO

      Don HO - 2007-11-24

      > Could you add such feature like close whole editor after last opened file(tab) is closed.

      Negative. Use menu File->Exit - it exists for that!
      I don't want this behaviour personally since I often close all the files then keep a new one to do the draft.

      Don

       
    • Harry

      Harry - 2007-11-24

      I do vote for a fix the the working directory though, couldnt it be set to the location of the notepad++ executable if no file is opened? I personally think that if you were to close all files there would be no more context for notepad++ to refer to that last directory it had used.

      That exit feature would be kind of unneeded, what would happen if notepad++ were to start up with no files open? Close again? :->

       
    • Philippe Verdy

      Philippe Verdy - 2007-11-24

      In other words: we DO NEED to close Notepad++ COMPLETELY. Leaving it open with a new empty file is harmful as long as Notepad++ locks things it should not have to lock exclusively (and I've seen that Notepad++ is leaking some directory change listeners even though it does no logner need them (as there's no file currently open in those directory, so such listener is NOT needed to automatically detect changes in another process).

      Ideally, Notepad++ should be able to release ALL its lock when closing ALL files, and then being able to stay running in the System Tray only, ready to load a new file immediately (as all its plugins are already loaded). But as long as there's no such mode, there's ABSOLUTELY NO NEED to keep Notepad++ open after closing the last file. It's best (and safer) to exit it completely.

      The leaking "locked current working directory" is HARMFUL in multi-user environments, because it can locks a shared directory on another server, and it may block other users (or administration tools) from cleaning up empty directories (notably in unique folders created for temporary objects). In some case, it could block or hand a precious webserver or SQL server, blocking it from normal cleanup operations!

       
      • Nobody/Anonymous

        We really need to exclude YOU from the forum. You are only spamming your critics about it.

        And you are SO smart, of course ANY application should automatically close when all its documents are closed, like Word, any programmer's IDE etc. Therefor, also this "Close All" menu item must be so RIDICOLOUS to (I'd prefer: as) you, since it has absolutely no other use than the the Exit option.

        But I suggest YOU exit here, ending all your attempts to convince us of your stupid ideas, and automatically uninstall, because we don't ever want to use you again. You could also automatically format your harddisk, unFDISK em, and let your PC explode. So you don't have to do anything with it anymore, and it's all cleaned up. Right?

         
        • Don HO

          Don HO - 2007-11-24

          > We really need to exclude YOU from the forum.

          Well, I won't say that.
          But it's true that you should read the older posts before you write - it'll save you a lot of typing time :)

          As well, the philosophy of Notepad++ project (same as all the Free Softwares) is :
          The project is not belong to anyone, since the source code is available and your right to modify it and to redistribute your modify code is protected by GPL.

          So feel free to get the source code and modify it as you want.
          If you want your modification included in the official release so anyone can benefice from it, your contribution is welcome.

          Here you can post your patch:
          http://sourceforge.net/tracker/?group_id=95717&atid=612384
          It'll be more appreciated then the bug report or feature request.
          As the only developer in Notepad++ program, I prefer to deal with patches than with the bugs or feature requests.

          OTOH, it's not a kind attitude to ask someone to do the feature you need. Those ones who work on this projects (The plugin authors, the translators, the ones answer the question in this forum) are all volunteers - they don't get pay from you. In order to get more out of us, you should consider trading in some of your time and efforts in return.

          Don