You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Edit Database Cell] Enable simple text search/replace within cell content. #1746
When I store documents as blobs to a table and then browse the cells in the "Edit Database Cell" view, it would be very helpful for a context menu to enable simple text search/replace.
Now I must copy and paste the cell into notepad or similar for simple searches and edits.
Additional info
Is your feature request related to an issue? Please include the issue number.
No.
Does this feature exist in another product or project? Please provide a link.
Of course, but not sure of all db browsers. Basic context menus for text searches are so innate I was surprised by its omission.
As a workaround, you could switch to the XML or JSON mode, which have replace dialogs (Ctrl+H or context menu). It will give you incorrect syntax highlighting and inconvenient syntax validations, but it might be easier than your current trick with the external editor.
It might make sense to get rid of the plain Qt text widget and give a text mode in the QScintilla widget, because it is cumbersome having to implement the features for both. But some users would prefer the plain widget for text, due to look&feel or simplicity reasons. Any opinions?
Another possible feature that would streamline your approach is support for external editors of cell data. The data would be saved to temporary file (using the internal export logic) and open in the default application for that data. We would have to monitor that process and when it ends, we load the temporary file. The main concern is implementing this in a portable way. QDesktopServices::openUrl could be used for the opening part, and QProcess::start for process launch and monitoring, but in principle there's no way to link both.
Whoa 😮 I did not know Search/Replace was already available in XML/JSON?
That is a great workaround.
Why not enable the same feature for text mode?
As a scintilla gadget, I love the line numbers and it would be great to add custom syntax highlighting contained within the project file?
I am less inclined to choose an external editor. These are for minimal changes and scanning. Any more detail would be handled in the native source editor along with its customized syntax.
The current text widget is the standard text widget in the Qt library we use for the GUI and for portability. It has different programming interfaces than the QScintilla widget that we use for SQL, JSON and XML. Adding the feature for the current standard text widget would mean to program an adaptation layer or make a different new implementation of the dialog. It's possible but it requires some effort. That's why I propose to use QScintilla also for the plain text mode.
As a scintilla gadget, I love the line numbers and it would be great to add custom syntax highlighting contained within the project file?
Scintilla comes with syntax highlighting for a lot of languages, but the supporting code has to be built into the application, so we've only added in the application what we are using (JSON and XML, which we consider usual data formats). So we are currently constrained to that. Do you use other data formats that QScintilla supports? You can see a list of supported languages (lexers) here.
Yeah, I guessed it would be hardcoded to the gadget. Still, it has plenty of built-in lexers.
I would love to see my blob cells syntax highlighted: CSS, SQL, batch, html, markdown, even SPICE!
My vote is use the Scintilla gadget and drop the simple text gadget.
You already have binary view to show unaltered content, albeit in hex view.
@MKleusberg@chrisjlocke@justinclift Do you agree on getting rid of the standard Qt widget for the Edit Database Cell in the text mode and using the QScintilla widget in a plain text mode? This will solve this issue (find/replace dialog) and hopefully #1793 too.
Another question is whether we add also other syntax highlighting modes. It would require including the necessary code to the application from the QScintilla library. Currently we are only adding the minimal set of files that we need (that only occurs using the internal QScintilla version, I suppose).
It seems that we don't loose any feature, so I've made the change and I think it is a clear gain. The text mode is now using the QScintilla widget too. The shortcut Ctrl+H can trigger now the Find/Replace dialog in this mode.
Yes, [Ctrl+H] functionality is good.
Is it much more effort to add the standard editing keyboard shortcuts?
[Ctrl+F] = Find
[F3] = Find Next
[Shift+F3] = Find Previous
Is it much more effort to add the standard editing keyboard shortcuts?
[Ctrl+F] = Find
[F3] = Find Next
[Shift+F3] = Find Previous
I've added the Ctrl+F shortcut to the Scintilla widgets in order to open a modified version of the Find/Replace dialog, but just for searching.
F3 is also bound to the Find Next button, inside the dialog, but Shift+F3 would require adding a Find Previous button and I don't want to overcrowd the dialog (there is already a "Search backwards" checkbox).
Confirmed feature with v190407. 👍
[Shift+F3] would be desirable for large texts as this is an editor standard.
Clicking '[x] Reverse Direction' is no fun when browsing large text in both directions.
Activity
mgrojo commentedon Feb 14, 2019
As a workaround, you could switch to the XML or JSON mode, which have replace dialogs (Ctrl+H or context menu). It will give you incorrect syntax highlighting and inconvenient syntax validations, but it might be easier than your current trick with the external editor.
It might make sense to get rid of the plain Qt text widget and give a text mode in the QScintilla widget, because it is cumbersome having to implement the features for both. But some users would prefer the plain widget for text, due to look&feel or simplicity reasons. Any opinions?
Another possible feature that would streamline your approach is support for external editors of cell data. The data would be saved to temporary file (using the internal export logic) and open in the default application for that data. We would have to monitor that process and when it ends, we load the temporary file. The main concern is implementing this in a portable way. QDesktopServices::openUrl could be used for the opening part, and QProcess::start for process launch and monitoring, but in principle there's no way to link both.
sky5walk commentedon Feb 14, 2019
Whoa 😮 I did not know Search/Replace was already available in XML/JSON?
That is a great workaround.
Why not enable the same feature for text mode?
As a scintilla gadget, I love the line numbers and it would be great to add custom syntax highlighting contained within the project file?
I am less inclined to choose an external editor. These are for minimal changes and scanning. Any more detail would be handled in the native source editor along with its customized syntax.
mgrojo commentedon Feb 14, 2019
The current text widget is the standard text widget in the Qt library we use for the GUI and for portability. It has different programming interfaces than the QScintilla widget that we use for SQL, JSON and XML. Adding the feature for the current standard text widget would mean to program an adaptation layer or make a different new implementation of the dialog. It's possible but it requires some effort. That's why I propose to use QScintilla also for the plain text mode.
Scintilla comes with syntax highlighting for a lot of languages, but the supporting code has to be built into the application, so we've only added in the application what we are using (JSON and XML, which we consider usual data formats). So we are currently constrained to that. Do you use other data formats that QScintilla supports? You can see a list of supported languages (lexers) here.
sky5walk commentedon Feb 15, 2019
Yeah, I guessed it would be hardcoded to the gadget. Still, it has plenty of built-in lexers.
I would love to see my blob cells syntax highlighted: CSS, SQL, batch, html, markdown, even SPICE!
My vote is use the Scintilla gadget and drop the simple text gadget.
You already have binary view to show unaltered content, albeit in hex view.
mgrojo commentedon Mar 8, 2019
@MKleusberg @chrisjlocke @justinclift Do you agree on getting rid of the standard Qt widget for the Edit Database Cell in the text mode and using the QScintilla widget in a plain text mode? This will solve this issue (find/replace dialog) and hopefully #1793 too.
Another question is whether we add also other syntax highlighting modes. It would require including the necessary code to the application from the QScintilla library. Currently we are only adding the minimal set of files that we need (that only occurs using the internal QScintilla version, I suppose).
Drop the QTextEdit widget in the Edit Database Cell dock
mgrojo commentedon Mar 10, 2019
It seems that we don't loose any feature, so I've made the change and I think it is a clear gain. The text mode is now using the QScintilla widget too. The shortcut Ctrl+H can trigger now the Find/Replace dialog in this mode.
sky5walk commentedon Mar 10, 2019
Yes, [Ctrl+H] functionality is good.
Is it much more effort to add the standard editing keyboard shortcuts?
[Ctrl+F] = Find
[F3] = Find Next
[Shift+F3] = Find Previous
chrisjlocke commentedon Mar 10, 2019
Well done @mgrojo. I must admit I don't use the 'edit cell' function that much, but any improvement is obviously good. 👍
justinclift commentedon Mar 23, 2019
We should add this to the Keyboard shortcuts wiki page. 😄
Is "Edit dialog and edit pane" the right section?
Find dialog based on the Find/Replace dialog for the Scintilla widgets
Avoid ambiguity for Ctrl+F in the Execute SQL tab
mgrojo commentedon Apr 5, 2019
I've added the Ctrl+F shortcut to the Scintilla widgets in order to open a modified version of the Find/Replace dialog, but just for searching.
F3 is also bound to the Find Next button, inside the dialog, but Shift+F3 would require adding a Find Previous button and I don't want to overcrowd the dialog (there is already a "Search backwards" checkbox).
sky5walk commentedon Apr 7, 2019
Confirmed feature with v190407. 👍
[Shift+F3] would be desirable for large texts as this is an editor standard.
Clicking '[x] Reverse Direction' is no fun when browsing large text in both directions.
Enhancement: save to temporary file, open external application and re…