Bug in macro recording
-
I created a macro as follows
New
Language PHP
Ctrl-Vto 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.
-
@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 -
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.
-
@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 :
-
@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.
-
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. -
@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.
-
@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)?
-
@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? -
@Alan-Kilborn Here is, as requested: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/9012