Fix #6454: Expand tabs in Static widget before visualization#6484
Fix #6454: Expand tabs in Static widget before visualization#6484hugomath133 wants to merge 1 commit intoTextualize:mainfrom
Conversation
|
I don't understand why this only targets Static rather than a wider fix for other widgets? Was this PR generated using AI? |
|
I focused on Static because it was the specific widget where I encountered and reproduced the issue (Issue #6454). You're right that a more global fix would be better. I'm new to the codebase and wanted to ensure a working fix for the reported bug first. Regarding the AI, I used some assistance to navigate the framework's internals and handle the NoActiveAppError during unittests, but I've manually verified the fix with reproduction scripts and existing tests. I'd be happy to move this logic to a more central place (like the base Widget class or the visualize function) if you can point me to where you'd prefer this tab expansion to happen. |
|
No thanks, if I wanted to prompt an AI agent I'd just do it myself. |
Description:
This PR fixes issue #6454 where text selection offsets were incorrect when tab characters (\t) were present.
Changes:
Updated Static widget to expand tabs using self._app.tab_size (defaulting to 8) before visualization.
Handled cases where the widget might not be attached to an app (preventing NoActiveAppError).
Verification:
Verified with a reproduction script: selection now correctly identifies the column offset.
Ran tests/test_static.py and all tests passed.