BdR76 / CSVLint

CSV Lint plug-in for Notepad++ for syntax highlighting, csv validation, automatic column and datatype detecting, fixed width datasets, change datetime format, decimal separator, sort data, count unique values, convert to xml, json, sql etc. A plugin for data cleaning and working with messy data files.
GNU General Public License v3.0
161 stars 10 forks source link

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

Closed molsonkiko closed 3 months ago

molsonkiko commented 8 months ago

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:

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 commented 6 months ago

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.

molsonkiko commented 6 months ago

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 commented 3 months ago

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