• Login
Community
  • Login

Bug in macro recording

Scheduled Pinned Locked Moved General Discussion
10 Posts 2 Posters 477 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.
  • D
    Dario de Judicibus 0
    last edited by Oct 3, 2020, 11:46 AM

    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.

    A 1 Reply Last reply Oct 3, 2020, 11:52 AM Reply Quote 0
    • A
      Alan Kilborn @Dario de Judicibus 0
      last edited by Oct 3, 2020, 11:52 AM

      @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
      • D
        Dario de Judicibus 0
        last edited by Oct 3, 2020, 11:56 AM

        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.

        A 1 Reply Last reply Oct 3, 2020, 12:03 PM Reply Quote 0
        • A
          Alan Kilborn @Dario de Judicibus 0
          last edited by Oct 3, 2020, 12:03 PM

          @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

          D 1 Reply Last reply Oct 7, 2020, 8:19 AM Reply Quote 3
          • D
            Dario de Judicibus 0 @Alan Kilborn
            last edited by Dario de Judicibus 0 Oct 7, 2020, 8:19 AM Oct 7, 2020, 8:19 AM

            @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
            • A
              Alan Kilborn
              last edited by Oct 7, 2020, 12:07 PM

              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.

              D 2 Replies Last reply Oct 8, 2020, 9:19 AM Reply Quote 2
              • D
                Dario de Judicibus 0 @Alan Kilborn
                last edited by Oct 8, 2020, 9:19 AM

                @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
                • D
                  Dario de Judicibus 0 @Alan Kilborn
                  last edited by Oct 8, 2020, 9:25 AM

                  @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)?

                  A 1 Reply Last reply Oct 8, 2020, 3:16 PM Reply Quote 0
                  • A
                    Alan Kilborn @Dario de Judicibus 0
                    last edited by Oct 8, 2020, 3:16 PM

                    @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?

                    D 1 Reply Last reply Oct 15, 2020, 12:00 PM Reply Quote 0
                    • D
                      Dario de Judicibus 0 @Alan Kilborn
                      last edited by Oct 15, 2020, 12:00 PM

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

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