New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Paste" is wrongly disabled in some cases #11401
Comments
Mhh, what would you expect a paste to do when a file is in the clipboard? |
You missed the part where they copy text from notepad++ afterwards and paste stays disabled (until the cursor is moved). You can in fact paste (via keyboard) in that situation, just the menu entry doesn't get updated right away. |
Thank you for clarifying that. |
Oh, I am sorry. |
A quick PR if you're interested. :) After
After
After
|
It is weird that the N++ main wnd does not receive any notification or msg about the keyboard use in this case. Here is also an 'one-place' solution for the ScintillaEditView.cpp:
@Yaron10 |
Thank you for looking into it. The problem also exists on copying via a plugin. Another point which might help you pinpoint the cause:
I did. :) |
Also, the user might set a different shortcut for copying. |
Ok, so then your solution is better. I quickly checked the scite446 behavior in such situation and its main wnd receives a WM_COMMAND message, so it has not the same problem as the N++ (it also means, that it is not a problem of the included Scintilla control but a N++ one).
Whatever issues the |
👍 I'd be glad if you could implement it as scite446 does. Just curious: what's the WM_COMMAND message? |
I think that the N++ has problem with translation of the accelerator keystrokes. SciTe receives the Ctrl+C in its main-wnd
N++ main-wnd receives nothing, only the included Scintilla edit-control. |
I meant to ask what triggers the WM_COMMAND message on Ctrl+C. Thank you. |
Do you mean that since Ctrl+C is associated with Copy, a WM_COMMAND is sent but COPY_ID is NOT? EDIT: |
Yes, that's it, perfect find! That is why the relevant mouse-action (right-clicking & 'Copy') does not have this problem, because of it ends up in the N++ main wnd-proc with the
Consequently it also ends up in the Scintilla wnd-proc:
But when we press the Ctrl+C, it goes directly to that Scintilla part only. Probably if we fix the N++ accelerator's stuff instead of fixing only this specific issue (e.g. by the patch suggested by you above), the issue 9260 will be fixed too. |
Thank you for the explanation. On using the menu
is called and then case IDM_EDIT_COPY: .
Is
Great. That certainly would be better. |
Yes, using the N++ main menu 'Copy' is correctly interpreted as the
No, I tried e.g. the Ctrl+R (reloading of the current file) and it works as it should, the
But keystrokes like the Ctrl+C are evidently handled differently, so these are not translated to the above |
I did some "stuff" with this once, and had to investigate how it all works. It's HERE -- maybe there is something related of value there. |
Now I see, why it behaves like described in this issue. @alankilborn Edited: Yes, the last paragraph in that Community discussion contribution describes this unusual Ctrl+C behavior.
Even the oldest (Apr 25, 2009) history for the "./PowerEditor/src/Parameters.cpp" has the same form. |
👍 The more I understand the issue, the more I realize how some of my previous comments/questions here were irrelevant. So we need to move the shortcuts whose commands we want to be handled by NPP from 👍 |
I'm looking forward to the ocean. :)
May I ask why? |
Well, there are two possibilities:
I will uncomment (and correct) these for myself, then I will test the behavior of such binary. We will see. |
I don't know.
Great. 👍 |
A possible explanation for commenting those commands in Using So perhaps for some "consistency" - they were all moved to The "Delete" menu entry is disabled if there's no selection in most editors and also in Windows Edit-Controls. EDIT: I also don't understand why
|
I have not forgotten about this issue, I just do not have enough spare time. My patched version of N++ is working ok, until now I did not register any problem. So I still does not understand, why these shortcuts have to be disabled in the The
Maybe this was the historical reason, why these have remained under the |
Thank you for replying. I appreciate it.
Do you mean you have added |
@Yaron10 |
Thank you. Whenever you have free time. |
I can confirm that behavior.
The problem is, how the TranslateMessage WINAPI handles some special keyboard input, namely the The current N++ implementation is lazy - the I successfully tested these moves (
I think that all of these should be in the |
Thank you for the explanation. 👍
I agree it's inconsistent.
I think so too. OFF-TOPIC: I've built the new source files (121a396) with Visual Studio 2017 (I've changed the Toolset to v141). It's built successfully, but I get the following warnings:
Should I change anything for the second warning when building x64? I'd appreciate your help. |
I misread your list. |
Tried the same with the MSVS2017 and the current master just now:
You can check your libLexilla MACHINE setting:
I intentionally did not move the
This is what Scintilla does for us in such case: ".\notepad-plus-plus-master\scintilla\src\Editor.cxx" -> Editor::WndProc()
and I do not want to replicate these calls functionality myself, maybe you have more time for that? |
Or make sure the "Platform" configuration is explicitly "x64".
You can safely ignore the linker warning in any case. Both Lexilla and Scintilla are built as static libraries, which end up in the same EXE as the application code. The |
Thank you both for the helpful replies. I appreciate it.
So this warning is not related to VS 2017 and it's generated when using VS 2019 without modifying anything. Is that correct?
If I don't ignore it, should I manually change it when switching between x32 and x64?
I don't quite understand it.
Shouldn't the Delete keystrokes be processed by |
Correct; it's emitted even if I pass /p:PlatformToolSet=v142 to msbuild. From what I can tell,
It won't hurt; but again, as long as the compiler is generating object code for the right platform, the "librarian" should not need any hint about what to do with static libraries (i.e., nothing at all). |
Thanks again for the detailed explanation. Much appreciated.
Would you mind doing that? |
|
Thank you. |
Those shortcuts are commented in For example: |
@Yaron10 |
👍 |
I tried - you are right, we cannot simply move the Ctrl+C, Ctr+V... to the |
STR:
Copy externally some file or image so that "Edit -> Paste" should be disabled.
Select some text in NPP.
Press "Ctrl+C".
Result:
"Edit -> Paste" is wrongly disabled.
Notepad++ v8.3.3 (64-bit)
Build time : Mar 15 2022 - 00:15:25
Path : C:---\notepad++.exe
Command Line :
Admin mode : ON
Local Conf mode : ON
Cloud Config : OFF
OS Name : Windows 10 Pro (64-bit)
OS Version : 2009
OS Build : 19042.985
Current ANSI codepage : 1255
Plugins : ComparePlus.dll HTMLTag.dll MenuIcons.dll PythonScript.dll _CustomizeToolbar.dll
The text was updated successfully, but these errors were encountered: