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

View XML with markup in Query tab results #136

Closed
YetAnotherRussian opened this issue Feb 13, 2018 · 13 comments
Closed

View XML with markup in Query tab results #136

YetAnotherRussian opened this issue Feb 13, 2018 · 13 comments
Labels
Milestone

Comments

@YetAnotherRussian
Copy link

Expected behavior

Built-in XML viewer or show as a link (for system external viewer) or tooltip with textarea style (with margins and line breaks)

Current behavior

Veeeery long tooltip w/o line breaks. It also has display timeout

Steps to reproduce (use case)

  1. Use SELECT statement to find rows containing XML data in any column(s)
  2. Wanna see full content (XML-style markup)

Context

New session (MS SQL), "▻Query" tab(s)

  • HeidiSQL version: 9.5.0.5196 64-bit
  • Database system + version: MS SQL Server 2008 R2
  • Operating system: Windows 10

Detailed screenshots:
heidi1
heidi2

@rentalhost
Copy link
Contributor

I think that in this case we should only limit the tooltip max length and display an ellipsis in cases like that. Additionally, provide a way to open the Text Editor in read-only (if we could not update the row at moment) or in write-mode (if is possible).

@rentalhost rentalhost changed the title [feature request] View XML with markup in Query tab results View XML with markup in Query tab results Feb 13, 2018
@YetAnotherRussian
Copy link
Author

YetAnotherRussian commented Feb 13, 2018

I'm not on Pascal side, sorry. In C# you are able to send any text to e.g. stock notepad through importing user32.dll library and sending your text through SendMessage() to a target process. Then, you can read or save this anywhere you want as a text file (not to database, of course, I did not mean direct xml save throgh UPDATE statement).

@rentalhost
Copy link
Contributor

Did you mean "open text in an external editor"?

@YetAnotherRussian
Copy link
Author

Yes. It's the simpliest way (rather than providing a built-in editor like MS SQL Management Studio does).

@rentalhost
Copy link
Contributor

@ansgarbecker I think valid this suggestion. So I think that we could make it available on Preferences to be an alternative to the default Text Editor (the [...] on text columns).

It could works like the Filezilla do: when you open some file to edit, it creates a temporary file with that content, and if you modify it, the app will ask if you wants to save changes. In this way, we just should take care about two situations:

  1. If Data Grid still is opened, so the field will be updated with the red arrow;
  2. If Data Grid is not available (eg. you are modifying a lot of files at same time), then it will ask to run an UPDATE query to save the changed content;

@ansgarbecker
Copy link
Collaborator

@YetAnotherRussian - some things you might not have noticed:

  • ony the data grid shows that hard coded ellipsis in the tooltip text [...] - and only as long as you did not press Ctrl+C, F2 or right mouse button (anything for which HeidiSQL knows it has to load the full row now). The query grids do not show that [...] at all.
  • you can rightclick any grid cell, then click "Save to file":
    grafik
  • pressing F2 on a field normally brings up an internal text editor, unless the result is non-editable.

Two things which would help here most in my eyes:

  • allow F2 to show the text editor - read only if the result is non-editable
  • extend the internal popup text editor with other highlighters. SynEdit (already part of the HeidiSQL sources) provides support for many different code languages, for example xml, html, json, etc. What I have in mind is providing a dropdown in the text editor's toolbar, where the user can select a fitting highlighter, then Heidi remembers that setting for all other fields in the same row of the same table.

@rentalhost
Copy link
Contributor

Hm... I thinks that an external editor seems better in general way. I could just open an image to Photoshop, save and update the binary content, for instance.

It could be done?

@ansgarbecker
Copy link
Collaborator

I think we're about to lose the point of the initial reporter here, which only asked for

View XML with markup in Query tab results

Anyway, that external app thing is a nice idea, but should probably have its own ticket.

@rentalhost
Copy link
Contributor

Oh, you are right at this point. So based on current ticket, I think that supports specific language markup will give to HeidiSQL one more responsability that goes beyond of to be a database manager. And maybe this feature is very public specific at time.

So I think that the best solution here is close this ticket while I write a new ticket about the external editor support. 😃

@ansgarbecker
Copy link
Collaborator

This is how it looks like after some hours I spent on it, replacing the standard memo with a mighty TSynMemo:

grafik

There are quite a few other highlighters, e.g. for JSON, HTML, PHP, even for TeX and ZPL.
I left some todos unfinished:

  • search/replace dialog does not work with the new editor
  • displayed caret position is now broken, have to find a different approach
  • provide highlighter customizations

ansgarbecker added a commit that referenced this issue Mar 16, 2021
…th a TSynMemo. And provide all supported highlighters in a drop-down, remembering the previously selected highlighter.
ansgarbecker added a commit that referenced this issue Mar 16, 2021
…time. Not sure why I moved that in 2015.

* support find/replace using our self baken dialog
* fix non-working shortcuts for find/replace actions
ansgarbecker added a commit that referenced this issue Mar 16, 2021
…t' has not been expanded because unit 'System.Types' is not specified in USES list
ansgarbecker added a commit that referenced this issue Mar 16, 2021
ansgarbecker added a commit that referenced this issue Mar 16, 2021
ansgarbecker added a commit that referenced this issue Mar 17, 2021
ansgarbecker added a commit that referenced this issue Mar 17, 2021
…ppSettings.SessionPath := GetRegKeyTable, indirectly by TAppSettings.PrepareRegistry
@ansgarbecker
Copy link
Collaborator

I think I can safely consider this as done. The only doable thing which might now be missing is the highlighter customizations. I will probably do that in a future commit.

Apart from that, there are some enhancements here I didn't even expect:

  • search/replace now uses the more feature-rich dialog which is also used for SQL editors
  • modified lines are marked with a color bar in the left gutter
  • supports 64 different code languages (if I did not miscount)

grafik

@ansgarbecker
Copy link
Collaborator

One additional thing to note: the language selector is restored for edited columns in the data tab, but not in the query tabs (the query tab columns don't have unique identifiers which could be used to identify them the next time)

ansgarbecker added a commit that referenced this issue May 13, 2021
ansgarbecker added a commit that referenced this issue Feb 27, 2022
… SQL highlighter when copying from grid text editor
ansgarbecker added a commit that referenced this issue Oct 3, 2022
…000/verysimplexml to reformat XML in grid cells.

Also, auto-disable slow wordwrap in editor if text is > 1M large
@ansgarbecker
Copy link
Collaborator

Next build has a reformatter for XML:
grafik

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

3 participants