https://bugs.kde.org/show_bug.cgi?id=524411
Bug ID: 524411
Summary: Unexpected automatic bracket closing for apostrohes
Classification: Applications
Product: kate
Version First 26.04.3
Reported In:
Platform: Fedora RPMs
OS: Linux
Status: REPORTED
Severity: minor
Priority: NOR
Component: application
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
DESCRIPTION
When Kate is configured to automatically close brackets, quotation marks (")
are treated as brackets, but apostrophes (') are not - which is good. However
when HTML is defined as the current syntax and the cursor is in front of a less
sign (<) or an ampersand (&), that behavior changes: When one apostrophe is
entered in that situation, two are inserted and the cursor is placed between
them.
Under these special circumstances ' is treated exactly like ". That means, when
the closing apostrophe is automatically created any you press BACKSPACE, both
apostrophe are deleted. If a matching apostrophe exists in same line before the
current cursor position, then no second one is created. This is the same logic
as with quotation marks.
Note: KWrite shows the same effect as Kate.
STEPS TO REPRODUCE
1. Start Kate (or KWrite) and create a new document. You don't need to save
it.
2. Go to "Configuring Kate -> Editing -> General" and enable "Brackets:
Automatically close brackets when opening bracket is typed".
3. In "Tools -> Highlighting" select "Markup -> HTML".
4. Enter the text "abc<" and put the cursor right before "<".
5. Press the apostrophe key (').
OBSERVED RESULT
Two apostrophes appear and the text becomes "abc''<".
EXPECTED RESULT
Only one apostrophe should appear and the text should be "abc'<".
SOFTWARE/OS VERSIONS
Kate version: 26.04.3
Operating System: Fedora Linux 44
KDE Plasma Version: 6.7.4
KDE Frameworks Version: 6.29.0
Qt Version: 6.11.1
ADDITIONAL INFORMATION
On Mint I use the same version of Kate as on Fedora, but as an AppImage. The
effect is the same there.
The strange behavior does not only occur with the HTML syntax highlighter, but
also with XHTML and XML. Highlighters for languages where "<" and "&" don't
need to be masked don't seem to be affected.
That whole thing is not critical, just a bit annoying. When writing HTML text,
where the cursor is often in front of a "<", typing things like "that's cool"
is not so cool when you have to take care of superfluous apostrophes.
--
You are receiving this mail because:
You are watching all bug changes.