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

[Bug] Editor – Shortcomings of "Mark occurrences" #1208

Open
1 task done
Andreas0602 opened this issue Jun 8, 2024 · 9 comments
Open
1 task done

[Bug] Editor – Shortcomings of "Mark occurrences" #1208

Andreas0602 opened this issue Jun 8, 2024 · 9 comments
Assignees
Labels

Comments

@Andreas0602
Copy link

Andreas0602 commented Jun 8, 2024

Is there an existing issue for this?

  • I have searched the existing issues (including the closed ones)

Description

Please see the attached video.

Bug 1 (at 00′17″ in the video): All occurrences of the search term "555" are marked, although "Mark occurrences" has been disabled.

Bug 2 (at 00′26″ in the video): After typing "AAA" (so that the first occurrence of "555" gets replaced by "AAA"), the space after "AAA" will be marked.

Shortcoming (at 00′29″ in the video): It is not possible to make the orange marks go away (e.g. by moving the cursor) when they are no longer needed/wanted.

Demo.webm

Steps to reproduce

see above

Expected behavior

see above

Actual behavior

see above

Screenshots?

No response

muCommander version

Version: 1.5.0
Build date: 2024/06/08
Build number: 74a2a98

Java version

Runtime version: 23-internal
VM name: OpenJDK 64-Bit Server VM
VM version: 23-internal-ahadas-0081ac197a656cdc0d88d5a5e2a0f399ee023654
VM vendor: Oracle Corporation

Operating System type and version

Name: Mac OS X
Version: 14.5
Architecture: aarch64

Relevant log output

No response

@pskowronek
Copy link
Member

pskowronek commented Jun 8, 2024

Bug 1 (at 00′17″ in the video): All occurrences of the search term "555" are marked, although "Mark occurrences" has been disabled.

It is not a bug per se. "Mark occurrences" means the occurrences of words when syntax highlighting is on (like if you opened .java file, then you will see the occurrence of selected variable for example).

Bug 2 (at 00′26″ in the video): After typing "AAA" (so that the first occurrence of "555" gets replaced by "AAA"), the space after "AAA" will be marked.

Shortcoming (at 00′29″ in the video): It is not possible to make the orange marks go away (e.g. by moving the cursor) when they are no longer needed/wanted.

@Andreas0602 , For this - can you create a bug in RSyntaxTextArea?

However, I tried to turn off the behavior for search and I had no luck, neither by using context.setMarkAll(false) nor via textArea.setMarkAllOnOccurrenceSearches - I will create a separate bug/issue to RSyntaxTextArea.

Checked with the newest released version RSyntaxTextArea (3.4.0) - current master of muC is using that.

@Andreas0602
Copy link
Author

Andreas0602 commented Jun 9, 2024

It is not a bug per se.

I'm not convinced. I've tested it with a small .cpp source file, and the behavior is not okay there either.

For this - can you create a bug in RSyntaxTextArea?

I've opened a bug report for all three issues: bobbylight/RSyntaxTextArea#547

@pskowronek
Copy link
Member

pskowronek commented Jun 9, 2024

It is not a bug per se.

I'm not convinced. I've tested it with a small .cpp program, and the behavior is not okay there either.

In other words, "Mark occurrences" setting is to mark or not the occurrences of a selected word, nothing to do with searched word. It might have the same visual defects as for bug 2, but the setting is solely for highlighting selected word, not searched. In muC we could combine this and 'search' by setting two options in RSyntaxTextArea, but, I said previously:

However, I tried to turn off the behavior for search and I had no luck, neither by using context.setMarkAll(false) nor > via textArea.setMarkAllOnOccurrenceSearches - I will create a separate bug/issue to RSyntaxTextArea.

@Andreas0602
Copy link
Author

In other words, "Mark occurrences" setting is to mark or not the occurrences of a selected word

Okay, but that doesn't work either.

@pskowronek
Copy link
Member

In other words, "Mark occurrences" setting is to mark or not the occurrences of a selected word

Okay, but that doesn't work either.

When enabled:
obraz

When disabled:
obraz

@Andreas0602
Copy link
Author

Andreas0602 commented Jun 9, 2024

Okay, I see. It doesn't work when you double-click a word, but it does work when you put the cursor into a word without selecting it and then wait a bit. That's quite weird IMO. Other editors and IDEs behave differently.

@pskowronek
Copy link
Member

Okay, I see. It doesn't work when you double-click a word, but it does work when you put the cursor into a word without selecting it and then wait a bit. That's quite weird IMO. Other editors and IDEs behave differently.

In Intellij IDEA it works this way (i.e. like in RSyntaxTextArea), the difference is that RSyntaxTextArea has a default 1s delay before it starts marking the occurrences.

RSyntaxTextArea#setMarkOccurrencesDelay javadoc: https://github.com/bobbylight/RSyntaxTextArea/blob/45dfcd707f15a56efb194ebebc1fbdf8768c9e38/RSyntaxTextArea/src/main/java/org/fife/ui/rsyntaxtextarea/RSyntaxTextArea.java#L2838C1-L2848C5

@Andreas0602
Copy link
Author

At work, in VS Code, it behaves differently. And privately, on the Mac, in CotEditor, it behaves differently too (same as in VS Code).

@pskowronek
Copy link
Member

Each types of IDE have their own flavors :) - apparently RSyntaxTextArea conveys a taste of IDEA and some others (like Eclipse).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants