Skip to content

[BUG] Ctrl-hover and Ctrl-click miss links with hanging list indentation #3853

Closed

Description

@pbek

Description

With hanging indentation enabled, valid Markdown links in a longer list-based note can fail to respond to Ctrl-hover highlighting and Ctrl-click opening. Removing unrelated list items can make the same link work again; the link syntax itself is valid.

Expected behavior

Ctrl-hover and Ctrl-click should recognize the link at its displayed position, regardless of wrapping in preceding list items.

Observed behavior and reproduction status

  1. Enable hanging indentation for Markdown lists.
  2. Open an affected note containing wrapped list items followed by a Markdown link.
  3. Ctrl-hover or Ctrl-click the displayed link: highlighting and opening fail.
  4. Removing other list items can make the problem disappear.

The reporter supplied a reduced private note and confirmed that building the patched current source fixes the original issue. The private note is intentionally not published. A portable manual Markdown reproducer has not yet been confirmed: the synthetic examples tried by the reporter did not reproduce the failure in their configuration.

Technical findings and fix

QMarkdownTextEdit temporarily applies hanging indentation while painting. Narrower continuation lines can add visual lines and move subsequent blocks. Calls to QPlainTextEdit::cursorForPosition() outside that temporary layout can therefore map the visible link position to a different text position or block.

Use the same temporary hanging-indent layout when hit-testing viewport positions, then restore the original layout. This also makes the derived editor's Ctrl-hover highlighting and Ctrl-click validation use the rendered geometry.

Validation

  • The reporter confirmed that the fix resolves the original issue after building current source.
  • Synthetic automated regression tests cover link hit-testing and Ctrl-click signals with and without a scrollbar, and restoration of the original layout. These tests contain only generic text and example.org URLs.
  • just nix-build succeeds.
  • The full unit test suite passes with Qt 6.11.2 on Linux using the minimal platform plugin.

The reporter's exact application version, font, and display configuration have not been recorded. The locally validated source version is 26.11.10.

Activity

  1. added 2 commits that reference this issue on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions