oleg-shilo / cs-script.npp

CS-Script (C# Intellisense) plugin for Notepad++ (x86/x64)
MIT License
248 stars 52 forks source link

After pressing Ctrl+S the DC3 symbols appear #55

Closed it19862 closed 9 months ago

it19862 commented 3 years ago

After pressing Ctrl+S the DC3 symbols appear. Is this a problem or should I ignore it? MSACCESS_2021-07-07_13-31-41

oleg-shilo commented 3 years ago

It is problem with the ScintillaTest control NPP is using or NPP itself. I noticed it too. It's not clear what it is causing but I suspect that NPP message loop does something naughty with the keyboard messages when plugins (like CS-script) hookup to the message loop via NPP hosting API.

I noticed that in most of the cases switching the doc tabs to another doc and back fixes it.

And since NPP is messing with the editor shortcuts (e.g. Ctrl+S) you can always use menu File->Save. Of course it is an inconvenience :(

PeterSt1 commented 2 years ago

I just noticed that this (at least) happens when the Styler dialog from the UDL Settings is open (which is allowed to be open while continuing editing). Close that dialog and all is fine again.

image

oleg-shilo commented 2 years ago

Interesting. It confirmes what I said. This behaviour is not triggered by any plugin but NPP message processing. :(

PeterSt1 commented 2 years ago

Yeah. Here's a similar situation I just found on StackOverflow. Only from 2010. :-)

A few minutes ago I did a "Replace all" in my current document. Apparently, the dialog window informing me that "# occurrences were replaced" was hidden under another window, so I never closed it.

I suppose the Messaging system is still waiting for messages, that overruling the Shortcuts (actually, undermining them).

oleg-shilo commented 2 years ago

I am convinced that having non-modal dialogs triggers that in one or another way. But I am not convinced it is the direct cause of it. Having non-modal dialogs is not an illegal SW dev pattern.

NPP API has a mechanism for subscription to the OS native messages. This mechanism is provided for plugins to get notifications on the IDE events including keystrokes. It's not ideal but works for most of the cases. I am guessing it has some flaw and possibly messes up with the keyboard messages when something (e.g. focus management) goes wrong. Thus it does not matter if it is a plugin or NPP own non-modal dialogue who is triggering it, we will see it from time to time.