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

Find/Replace Selected Lines broken in version 24.04 #29886

Open
coleman-rik opened this issue May 6, 2024 · 4 comments
Open

Find/Replace Selected Lines broken in version 24.04 #29886

coleman-rik opened this issue May 6, 2024 · 4 comments
Assignees
Labels
bug third party issue wait for review xf:sql editor SQL Editor and Editor Services like autocompletion, highlighting, folding, formatting, etc. xo:eclipse

Comments

@coleman-rik
Copy link

Description

In the lasted update of DBeaver the behavior of the Selected lines Scope radio button toggle chaged/is broken.
Previously when you selected a block of text then opened the Find/Replace dialog either one of two things happened:

  1. the Scope defaulted to Selected lines
  2. the Scope defaulted to All (which was anoying)

if you were lucky enough to be in situation 1, you just pressed whatever operation you wanted and the effects would be limited to the selected text.

if you were in situation 2, you would go back into the editor, reselect the block of text, which would toggle the Scope to Selected lines (sometimes, sometimes you would have to manually set it to Selected lines) and you could proceed as above.

After upgrading to the recent version, when you select a block of text and open the Find/Replace dialog the scope is set to Selected lines, if you then do any operation, it's applied to All lines in the editor.

The only way now to have the Find/Replace operations opperate on a selected text is to switch the scope from Selected lines to All and then back to Selected lines.

I hope that someone can fix this dangerous soon.

DBeaver Version

Community Edition 24.0.4

Operating System

Windows 10

Database and driver

No response

Steps to reproduce

  1. Have a bunch of text in an SQL Editor window
  2. Select several lines
  3. Cntrl-F to open the Find/Replace dialog.
  4. Note that the Scope is set to Selected lines
  5. Perform an operation (ex: replace all 'e' with '@') with Replace All
  6. Be dismayed as every matching text in the entire SQL Editor has been effected.

Additional context

No response

@coleman-rik
Copy link
Author

note:
why does DBeaver have two different selected modes?

apparently there's selected when the user selects things, and for things are select as the result of a Find operation [deep blue], but a different selected [slightly lighter blue] when thte Find/Replace dialog is going to actually limit it's operations to the selected area.

the second selected area doesn't honor the user selection, in that toggling the Scop radio buttons can often clear the user selection, and it can be confusing as to what's operations of the Find/Replace dialog are actually going to effect.

@E1izabeth E1izabeth added xf:sql editor SQL Editor and Editor Services like autocompletion, highlighting, folding, formatting, etc. and removed wait for review labels May 7, 2024
@E1izabeth E1izabeth added this to the 24.0.5 milestone May 7, 2024
@E1izabeth
Copy link
Member

I can stable reproduce it only if DBeaver window loose focus (for example, if I switched to some other app or pressed hotkey for screen recording).

@E1izabeth
Copy link
Member

E1izabeth commented May 7, 2024

This dialog comes to DBeaver from Eclipse platform. So, actually we inherit this bug from them eclipse-platform/eclipse.platform.ui#1819 eclipse-platform/eclipse.platform.ui#1235
It came in this version, because we just updated Eclipse version we use.

@coleman-rik
Copy link
Author

coleman-rik commented May 7, 2024

I can stable reproduce it only if DBeaver window loose focus (for example, if I switched to some other app or pressed hotkey for screen recording).

@E1izabeth I am sorry to confirm that I can reliably reproduce without ever leaving DBeaver or ever losing focus.

if I make DBeaver full screen, and never leave the application. Then:

  1. open a new SQL Editor window
  2. write/paste text into the editor
  3. select a subset of lines (notice that they are the dark blue, user selection)
  4. press Ctrl+F which will cause the Find/Replace dialog to open with Selected line Scope selected
  5. notice that the selection is still user selected and not the lighter find/replace selected
  6. type a common character in Find and a symbol in Replace so that the results will be obvious
  7. press Replace All
  8. watch in dismay as that replacement is done in the entire document.

as you can see in the steps outlined above, DBeaver never lost focus.

if at step # 5 you flip the Scope dialog from the defaulted Selected lines to All and then back to Selected lines (and you don't lose your selection, which happens sometimes) you will notice that the selection has changed from the user selection (dark blue) to the Find/Replace selection (light blue). Replace All will now function as expected.

I hope that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug third party issue wait for review xf:sql editor SQL Editor and Editor Services like autocompletion, highlighting, folding, formatting, etc. xo:eclipse
Projects
None yet
Development

No branches or pull requests

2 participants