PaulSquires / WinFBE

FreeBASIC Editor and Visual Designer for Windows
https://www.planetsquires.com
GNU General Public License v3.0
152 stars 39 forks source link

bug: Replace-dialog selection-highlight in code window out of sync with actual highlight (2nd+ selection) #26

Closed ghost closed 3 years ago

ghost commented 3 years ago

RECREATE: In code window, highlight a section of code with the intention to replace in selection. With code selected (in general selection color), go to Replace dialog (Ctrl-R), and edit Find, Replace fields. General selection highlight will be replaced with Replace-highlight color. Perform replace. Decide to highlight a different section of code near, but separate from original selection (so that you can see both areas at the same time). Return to code window and make selection. Newly selected code is highlighted in general highlighting color. But... ERROR: ...since new selection is near old one, it possible to see both, and to see that the Replace highlighting is still on the original selection, and not yet on the recent selection. Note that the Replace dialog is still open and values are in the fields. In the Replace dialog, edit one of the field values, either Find or Replace, and the new selection will then have the general selection highlight replaced with Replace-highlight color. However, the old selection area will still also have the replace highlight color. EXPECTED: With the Replace dialog active, the new selection would immediately use replace-highlighting. On a new selection, the old selection would immediately clear Replace-highlighting (and all selection highlighting). WORKAROUND: Despite the apparent drawing inconsistency, the most recent selection appears to be the operative one, and the user can continue to replace anyway. If the old highlighting is too distracting, it is possible to clear it by clicking the Selection button in the Replace dialog. VERSION: 2.1.8

PaulSquires commented 3 years ago

Excellent bug description - thanks! I was able to correct this problem by removing previous highlight areas when the edit control gained focus and also by monitoring if highlights already exist in the document should the user keep Find/Replace open but attempt to highlight multiple areas in the document (needed because the document would not receive multiple Focus notifications in this case).