You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is definitely some duplicated code in the codebase with regards to how keys are handled and converted from codepoints to events.
Consider these four instances, which are not necessarily the only ones:
I see lots of very similar bits and bobs, and things like multiple attempts at normalising key/codepoint names, etc.
These should probably be refactored into methods that we can use that will ensure consistency.
Throughout the code base, there are a couple of places (noted in #1830) where we take a Unicode name and make it more friendly, or take a 'friendly' name and try to recover the original Unicode name. We add a function to go from 'friendly' to the Unicode name, which tackles the issue highlighted in #1815.
Related issues: #1815, #1830.
There is definitely some duplicated code in the codebase with regards to how keys are handled and converted from codepoints to events.
Consider these four instances, which are not necessarily the only ones:
textual/src/textual/app.py
Lines 830 to 837 in be85063
textual/src/textual/_xterm_parser.py
Lines 253 to 264 in be85063
textual/src/textual/keys.py
Line 250 in be85063
textual/src/textual/keys.py
Lines 266 to 269 in be85063
I see lots of very similar bits and bobs, and things like multiple attempts at normalising key/codepoint names, etc.
These should probably be refactored into methods that we can use that will ensure consistency.
Related to: #1815
The text was updated successfully, but these errors were encountered: