Skip to content
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

Ctrl+C and Ctrl+X no longer work in forms for Notepad++ 8.6.1 and newer. #87

Closed
molsonkiko opened this issue Feb 7, 2024 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@molsonkiko
Copy link
Contributor

molsonkiko commented Feb 7, 2024

This issue does not apply to Notepad++ 8.6.2.

To replicate the issue:

  1. Install CSVLint 0.4.6.6 on Notepad++ 8.6.1 (32bit or 64bit, shouldn't matter).
  2. Copy some text to the clipboard (call this Original selection)
  3. Open the CSV Lint window in any document.
  4. Select some text in the CSV Lint window (call this CSV Lint selection)
  5. Copy the CSV Lint window selection using Ctrl+C.
  6. Observe that Original selection is still in the clipboard.
  7. Cut the CSV Lint window selection using Ctrl+X.
  8. Observe that Original selection is still in the clipboard.
  9. If desired, try doing similar things on the other forms in CSV Lint. You should find that Ctrl+C and Ctrl+X are broken everywhere.

Note that for any version after Notepad++ 8.6.2 (i.e., versions not yet released at the time of writing), there are (probably) two additional steps after step 2:

  • go to Settings->Preferences...->Editing from the Notepad++ main menu and uncheck Enable Copy/Cut Line without selection
  • make sure there is no text selected in the current Notepad++ document.

My proposed solution

You can fix this issue by following the process I describe in my NppCSharpPluginPack.

If you like, I can submit a PR. While this issue isn't hard to fix, it is annoying and finicky to fix because you have to visually compare the order of Controls.Add calls to the desired tab order for every form in your plugin.

@BdR76
Copy link
Owner

BdR76 commented Mar 10, 2024

This is an interesting find, you're right that CLTR+C doesn't seem to work from inside the CSV Lint docked window. But when you select a text in the docked window and right-mouse click and then select Copy (or Cut) from the popup menu, then it does work, indeed strange behaviour.

I'm not sure what's more work, submit changes as a PR or re-structure the CSV Lint pluin to use the new NppCSharpPluginPack as a basis. As it seems to fix some other issues as well (better dark mode, docked window integration). But also I don't know how important an issue this is, in terms of users running into this.

@BdR76 BdR76 added the bug Something isn't working label Mar 10, 2024
@molsonkiko
Copy link
Contributor Author

molsonkiko commented Mar 11, 2024

One thing I should warn you of, regarding my fix in NppCSharpPluginPack - it introduces some weird behavior that you may not want, discussed in this README section.

None of these issues are the end of the world, but all of them are at least mildly irritating, and some of them may not be fixable at all, so it's not entirely obvious to me that fixing this issue would be net positive. It is net positive for JsonTools and NppCSharpPluginPack, but those are very different plugins with very different UX demands.

If the issue above were more prominent, I would unreservedly recommend using NPPM_MODELESSDIALOG to register your forms. However, as noted above this behavior now only occurs if a setting is changed to a non-default value, so I am not sure doing this is worth the tradeoffs. This is especially true for you, because the bug does not affect modal dialogs (i.e., every form in your plugin except the CsvLintWindow).

That said, you also mentioned that you were interested in changing your dark mode behavior to match NppCSharpPluginPack. That is obviously a separate matter, but I can certainly submit a PR to implement that.

@BdR76
Copy link
Owner

BdR76 commented Jun 25, 2024

This was fixed in commit #88 to fix issue #83 and it's available in the new release CSV Lint v0.4.6.7

@BdR76 BdR76 closed this as completed Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants