The line endings of *.txt files are currently managed by git,
as specified in `.gitattributes`, which means they're checked out as
CRLF on Windows. I could either change the test to replace CRLF with LF
in the expected file content, or change `.gitattributes`, or change the
file saving itself to save different line endings per platform, and
the latter feels a bit better to me. Eventually it would be good to
support different line endings per file as well as different encodings,
with some auto-detection and a way to override the settings and reload.
I added another ANSI art sample, which now shows up in the gallery app's
snapshot, invalidating the test. Maybe I should stop adding sample art.
Or better yet, I should create a separate folder with just two files
so that I can add sample art freely without breaking the tests:
- one file that's small and centered
- one file that's large with scrollbars
`pytest --snapshot-update`
I reworked this so it edits the image directly, creating undo states
immediately when you type instead of when the textbox is later melded.
Now it can edit a different cell without complicating the code, as the
edits are done directly within the cursor movement code instead of
later when the 1x1 textbox is melded into the canvas.
This file was being automatically executed on (unrelated) file changes,
via this command line:
.venv\Scripts\python.exe -m pytest -p vscode_pytest --collect-only
There are no new errors or anything.
This silenced error is no longer generated:
/home/io/Projects/textual-paint/src/textual_paint/wallpaper.py:241:18 - error: Stub file not found for "xdg" (reportMissingTypeStubs)
Pyright doesn't understand that fill_style will never be changed,
between its declaration and the inner function's scope.
error: Argument of type "Color | None" cannot be assigned to parameter "b" of type "Color" in function "colors_match"
Type "Color | None" cannot be assigned to type "Color"
Type "None" cannot be assigned to type "Color" (reportGeneralTypeIssues)