mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
If you project has two patterns and one is very big, switching providers while the big file is being highlighted makes the small one skip its own coloring. The error was caused by a failure to interrupt the ongoing lengthy highlighting process in a timely manner. It appears that calling task interrupt allows the task to run to completion and when the task runs to completion then the retrying mechanism is not trigger and the small pattern never has a task assigned for coloring. This was fixed by creating a variable that signals the intention to interrupt the current highlighting process. The most used function in the highlighter (used to update the current token) checks the variable and throws an out of range exception causing the interruption of the current highlighter and triggering the retry mechanic.