Fix newline after URL keeps URL formatting

This commit is contained in:
Miguel Jacq 2025-11-08 14:52:22 +11:00
parent 1373c4ab06
commit 31604a0cd2
Signed by: mig5
GPG key ID: 59B3F0C24135C6A9
3 changed files with 11 additions and 1 deletions

View file

@ -690,6 +690,12 @@ class Editor(QTextEdit):
self._apply_normal_typing() # make the *new* paragraph Normal for typing
return
# If we were at end-of-line, make the *new* line plain (dont keep URL styling)
if not c.hasSelection() and c.atBlockEnd():
super().keyPressEvent(e) # insert the new paragraph
self._break_anchor_for_next_char() # clear anchor/underline/color for typing
return
# otherwise default handling
return super().keyPressEvent(e)