https://bugs.kde.org/show_bug.cgi?id=497328

            Bug ID: 497328
           Summary: Minimum "Variables" window size in the External Tools
                    configuration can be arbitrarily large
    Classification: Applications
           Product: kate
           Version: 24.08.1
          Platform: Kubuntu
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: scripting
          Assignee: kwrite-bugs-n...@kde.org
          Reporter: tux12...@justmail.de
  Target Milestone: ---

Created attachment 176525
  --> https://bugs.kde.org/attachment.cgi?id=176525&action=edit
Minimum window width 29179 pixels

SUMMARY

Minimum width of the Variables selection window of the External tools "Edit
Tool" window can depend on the longest line in the current document. With long
line numbers, the minimum window width can be 100k+ pixels.

STEPS TO REPRODUCE
1. Have a document with a long line, for example a minified JSON without line
breaks or whatever. 
  Use this Python one-liner to generate a 2k line to put into the editor:
`python -c "import secrets; print(secrets.token_hex(2000))"`
2. Click on Tools menu → External Tools → Configure…
3. Click "Add" → "Add Tool…"
4. In the Edit Tool window, click "{}" (Insert Variable) next to "Input:" to
configure the tools standard input
5. In the opened Variables window, click variable "Document:Text"
6. Observe that the minimum window width shoots up to accommodate the whole
line

OBSERVED RESULT

See attached screenshot. Minimum window width of the Variables window shoots up
to ~30k pixels when the document contains a line with 2k characters.

EXPECTED RESULT

The window should still fit on screen.

The window uses a QLabel to show the variable content. This label should either
be embedded in a scroll area or be somewhat sanitized to not blow up window
dimensions.

SOFTWARE/OS VERSIONS
Operating System: Kubuntu 24.10
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.6.0
Qt Version: 6.6.2
Kernel Version: 6.11.0-9-generic (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 3700X 8-Core Processor
Memory: 62.7 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1070/PCIe/SSE2


ADDITIONAL INFORMATION

Why I got that result: The PC game Factorio allows exporting designs via base64
encoded strings, which it outputs as a single line that can become quite large.
It also accepts input with line breaks. In-/output is done via the clipboard,
which encourages pasting into text editors. So I wanted to add a tool to
automatically re-format these to a text block for easier sharing and posting
online.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to