Alexey-T / CudaText

Cross-platform text editor, written in Free Pascal
Mozilla Public License 2.0
2.39k stars 166 forks source link

"View > Toggle word-wrap" is the same for all tabs instead if showing status for current tab #5492

Closed pintassilgo closed 2 months ago

pintassilgo commented 2 months ago

Tested with clean Cuda release.

  1. Be sure to have at least two open tabs, each one with at least one long line that can't fill in document width.
  2. By defauly, word-wrap is disabled, so "View > Toggle word-wrap" is unchecked on both tabs.
  3. Click this item to enable word-wrap for current tab.

Results: Now, "View > Toggle word-wrap" is checked for all tabs, but word-wrap is only enabled in a single tab.

The first item of "View" menu is a captions saying "--- Current tab properties ---", so items such as "Toggle word-wrap" should reflect current tab word-wrap state.

pintassilgo commented 2 months ago

Apparently, this issue affects every item under View menu, not just "Toggle word-wrap".

Tested with both Qt5 and Gtk Cuda versions.

By the way, I suggest to rename items removing "Toggle" from them. "Word-wrap", "Line numbers" and so on.

Alexey-T commented 2 months ago

What is missed here: setting flag FNeedUpdateMenuChecks when different tab gets focus. easy to fix.

Alexey-T commented 2 months ago

I suggest to rename items removing "Toggle" from them. "Word-wrap", "Line numbers" and so on.

but I like it more as now. it is more structured.

Alexey-T commented 2 months ago

Note: updating of checkmarks is run on timer 'idle event'. not immedeately.

pintassilgo commented 2 months ago

Thanks.

Not being immediately is not ideal, we can see the checkmark changing to checked/unchecked a moment after opening the menu, but it's OK, the important is now it's working.

By the way, maybe is this idle event the way to fix what I asked here? To disable "Rename" item in File menu when file is untitled (never saved).

Alexey-T commented 2 months ago

To disable "Rename" item in File menu when file is untitled (never saved).

Yes, good small idea, did it now.

pintassilgo commented 2 months ago

Thanks. Could this idle event trick fix the old issue #4893? It would actually be a workaround, just to minimize the issue.