Tk Source Code

View Ticket
Login
Ticket UUID: dd35d8b1e2aef9d2573ce44c9e9d5a9324f9a7f6
Title: Assertion failed when resizing the text widget
Type: Bug Version: revised_text
Submitter: fvogel Created on: 2024-01-16 18:51:51
Subsystem: 18. [text] Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2024-01-28 20:06:42
Resolution: None Closed By: nobody
    Closed on:
Description:

When running the example code here, and then resizing the window horizontally the text widget triggers a failed assertion:

Assertion failed: segPtr == data->textPtr->dInfoPtr->endOfLineSegPtr || segPtr == data->textPtr->dInfoPtr->endOfTextSegPtr, file tk\win\..\generic\tkTextDisp.c, line 3640

User Comments: fvogel added on 2024-01-28 20:06:42:

A few data from preliminary investigations:

  • Removing the assert altogether does not seem to have adverse effects. With the example given, there is no visible problem when resizing the window, and hyphenation happens as expected as far as I can see. This may question the relevance of the assert. That said, it was placed here on purpose.
  • The assert triggers for Dutch (TK_TEXT_HYPHEN_TREMA), Hungarian (TK_TEXT_HYPHEN_DOUBLE_DIGRAPH), and Polish (TK_TEXT_HYPHEN_REPEAT). NOT for the other languages/rules, i.e. not for Catalan, German, Norwegian, or Swedish.
  • The code path triggering the assert is only run when "-hyphens on" is specified for the text widget. That is, without hyphen support switched on at the text widget level, there is no problem.