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>+; -- toggle highlighting of quotes and brackets #931

Closed
G4OEU opened this issue May 20, 2022 · 4 comments · Fixed by #937
Closed

<ctrl>+; -- toggle highlighting of quotes and brackets #931

G4OEU opened this issue May 20, 2022 · 4 comments · Fixed by #937
Labels
bug Something isn't working

Comments

@G4OEU
Copy link

G4OEU commented May 20, 2022

Describe the bug
ctrl+; works only intermittently and then only incompletely. When it does appear to do something it highlights only some quotes (single and double) and only some brackets but more often none at all.

When it has highlighted some characters, that display can be changed in a random fashion by left-clicking in different parts og the GG window.

To Reproduce
Steps to reproduce the behavior:

  1. Open Guiguts with
    shortcuts.txt
  2. ctrl+; to toggle ON/OFF "highlighting of quotes and brackets" and observe behaviour. If it has highlighted some characters, move cursor to different parts of the GG window and left-click.

Expected behavior
That ALL quotes, single and double, and all 'brackets' in the file are highlighted. It is expected that each type of character is highlighted in a different colour.

Environment

  • Guiguts version: 1.4.0-test4 (I haven't as yet installed the public 1.4.0 release)
  • OS and version: Windows 10
  • Perl version:
  • Perl distribution:

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@G4OEU G4OEU added the bug Something isn't working label May 20, 2022
@windymilla
Copy link
Collaborator

I think this may be a misunderstanding of what the option does - it is for checking matching quotes/brackets.
According to the manual

This highlights the first occurrence of quote and bracket symbols preceding and following the current cursor position. It is useful when looking for missing symbols that normally occur as balanced pairs. The text range does not have to be pre-selected, but the search stops within a reasonable distance from the cursor. It looks for straight and curly double and single quotes, parentheses, and square brackets, and uses different colors to distinguish them.

So, if you click inside a quoted section, it will highlight the quotes at the beginning and end. It only ever highlights pairs, so if you click and the quotes you expected don't highlight, it's probably because there is no matching quote or it's of the wrong type. I hope that explains the way is changes "in a random fashion by left-clicking".

A version of the feature has been there for "a long time" - I improved and extended it in #789, so that it highlights things when you click inside the matching pair, when previously you had to edit the text there to make it highlight, and it also covers more things, like curly quotes.

I think the manual entry is fairly clear, but perhaps the menu button text is unclear and should say "Highlight Matching Quotes and Brackets"?

@G4OEU
Copy link
Author

G4OEU commented May 21, 2022

I'm working through the hotkeys.txt list and simply took at face value the brief description for each keyboard shortcut.

And yes, I have misunderstood its purpose from that brief description but agree that the manual page describes it clearly. Note

A rewording of the text in the hotkeys.txt file and in the menu button text would be helpful. It may be too long to say "Highlight Matching Quotes and Brackets Around Cursor Position" but the position of the cursor is key to its function/behaviour and should be mentioned in any descriptive text?

In the Help Menu section of the manual Charlie has helpfully included the entries from the hotkey.txt file. Although it would require effort to maintain, if the manual also has a fuller description of a shortcut in another section, then the entry in the Help Menu should link to it? Charlie will have a view on this.

@windymilla
Copy link
Collaborator

What about "Highlight Surrounding Quotes and Brackets"?
We could change the Help Menu entry for hot keys to open the existing Help menu manual page, which could be expanded and link to other parts of the manual. Then get rid of hotkeys.txt completely?

@G4OEU
Copy link
Author

G4OEU commented May 21, 2022

Both your suggestions above would be improvements, particularly the second one.

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

Successfully merging a pull request may close this issue.

2 participants