Community
    • Login

    Bug in macro recording

    Scheduled Pinned Locked Moved General Discussion
    10 Posts 2 Posters 471 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Dario de Judicibus 0D
      Dario de Judicibus 0
      last edited by

      I created a macro as follows

      New
      Language PHP
      Ctrl-V

      to create a new PHP file with content from clipboard. When it runs, New and Ctrl-V are executed, but Language PHP is not. I suppose this is a bug. Just consider that in the old version of Notepad++, when you created a new file, it was potentially created in the same folder of previous one and with the same language. Now, the first condition is honored, the second one is not. That is why I created such a macro.

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @Dario de Judicibus 0
        last edited by

        @Dario-de-Judicibus-0 said in Bug in macro recording:

        consider that in the old version of Notepad++, when you created a new file, it was potentially created in the same folder of previous one and with the same language

        Which old version are you referring to?
        As far back as I can remember, doing Ctrl+n (or equivalent) will create a new tab (but not a new file, so folder is irrelevant) with the Language as specified in the Settings menu > Preferences > New Document > Default language

        1 Reply Last reply Reply Quote 0
        • Dario de Judicibus 0D
          Dario de Judicibus 0
          last edited by

          Just load a file from a folder. Then load a file from a different folder. Place the cursor in first file content and press Ctrl-N. Then press Ctrl-S. Notepad++ will open the Save As dialog in the same folder of first file. Now place the cursor in second file content and press Ctrl-N. Then press Ctrl-S. Notepad++ will open the Save As dialog in the same folder of second file. Notepad++ has always worked in that way and it works so now too. It is a very useful feature, even if I do not know how many people know it.

          Alan KilbornA 1 Reply Last reply Reply Quote 0
          • Alan KilbornA
            Alan Kilborn @Dario de Judicibus 0
            last edited by

            @Dario-de-Judicibus-0 said in Bug in macro recording:

            Just load a file from a folder. Then load a file from a different folder. Place the cursor in first file content and press Ctrl-N. Then press Ctrl-S. Notepad++ will open the Save As dialog in the same folder of first file. Now place the cursor in second file content and press Ctrl-N. Then press Ctrl-S. Notepad++ will open the Save As dialog in the same folder of second file. Notepad++ has always worked in that way and it works so now too.

            So to me that sounds like you are retracting your statement from your first post, where you implied current Notepad++ does NOT do that?

            Indeed, what you describe is Notepad++ 's behavior by default. It is actually controlled by this setting in the Preferences :

            e614ed40-0d1c-406b-8bc2-047af3e350b2-image.png

            Dario de Judicibus 0D 1 Reply Last reply Reply Quote 3
            • Dario de Judicibus 0D
              Dario de Judicibus 0 @Alan Kilborn
              last edited by Dario de Judicibus 0

              @Alan-Kilborn NO, what I said it is not the Notepad++ does not allow to “follow the current document” but that in the past, when that option was enabled, it also set the language of new document the same of the current one. Now the language is always the default one. So, if you are editing PHP and CSS files, you have always to specify the language. In the past I had simply to put the cursor on a PHP document to get a new document based on same language and ready to be saved in the same folder.

              1 Reply Last reply Reply Quote 0
              • Alan KilbornA
                Alan Kilborn
                last edited by

                I went as far back as version 6.9 (oldest version I had handy) and the behavior when a new document is created via File > New (or equivalent) is to disregard the active file’s language when the New is invoked.

                Thus, I can’t replicate your behavior on this from some “old version”.
                Of course, if you could remember the version number of that old version, we could give it a try there as well.

                Dario de Judicibus 0D 2 Replies Last reply Reply Quote 2
                • Dario de Judicibus 0D
                  Dario de Judicibus 0 @Alan Kilborn
                  last edited by

                  @Alan-Kilborn Honestly I do not remember which one, because I updated to latest version, but it seems to me that was version 5.something.

                  1 Reply Last reply Reply Quote 0
                  • Dario de Judicibus 0D
                    Dario de Judicibus 0 @Alan Kilborn
                    last edited by

                    @Alan-Kilborn Anyway, it would be great to have a checkbox in “New Document” settings which allow to set as Default Language “Follow current document” too. If you are a developer, you often edit at the same time many documents with the same extension. For example php or cpp. When you create a new one, you usually want to create it with the same language of others. So, TXT as default language from scratch is ok, generally speaking, but a contextual choice would be great during development of code.

                    PS Is there a document that describes the API of NPP that can be used in JN (JavaScript code)?

                    Alan KilbornA 1 Reply Last reply Reply Quote 0
                    • Alan KilbornA
                      Alan Kilborn @Dario de Judicibus 0
                      last edited by

                      @Dario-de-Judicibus-0 said in Bug in macro recording:

                      it would be great to have a checkbox in “New Document” settings which allow to set as Default Language “Follow current document”

                      I suppose it is an OK idea.
                      You should probably make a feature request for it, as Notepad++ developers won’t see it here.
                      See HERE for how that is done.
                      If you do that, please post back here to a link with your official request.

                      Is there a document that describes the API of NPP that can be used in JN (JavaScript code)?

                      Sorry, I have no knowledge.
                      Maybe someone else?

                      Dario de Judicibus 0D 1 Reply Last reply Reply Quote 0
                      • Dario de Judicibus 0D
                        Dario de Judicibus 0 @Alan Kilborn
                        last edited by

                        @Alan-Kilborn Here is, as requested: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/9012

                        1 Reply Last reply Reply Quote 3
                        • First post
                          Last post
                        The Community of users of the Notepad++ text editor.
                        Powered by NodeBB | Contributors