-
Notifications
You must be signed in to change notification settings - Fork 815
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixing IME alignment for Input widget. TextArea remains unfixed. * Fix TextArea IME * Prefix unused unpacked variables with underscore * Updating IME preview location on scrolling in TextArea * Add CHANGELOG entry for IME positioning fix * Add CHANGELOG entry for new methods on Input and TextArea * Test TextArea terminal cursor position update * Tests for Input widget terminal cursor position updating * Test for IME when content scrolled
- Loading branch information
1 parent
0a1fc69
commit 864d671
Showing
8 changed files
with
126 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from textual.app import App, ComposeResult | ||
from textual.geometry import Offset | ||
from textual.widgets import Input | ||
|
||
|
||
class InputApp(App): | ||
# Apply padding to ensure gutter accounted for. | ||
CSS = "Input { padding: 4 8 }" | ||
|
||
def compose(self) -> ComposeResult: | ||
yield Input("こんにちは!") | ||
|
||
|
||
async def test_initial_terminal_cursor_position(): | ||
app = InputApp() | ||
async with app.run_test(): | ||
# The input is focused so the terminal cursor position should update. | ||
assert app.cursor_position == Offset(21, 5) | ||
|
||
|
||
async def test_terminal_cursor_position_update_on_cursor_move(): | ||
app = InputApp() | ||
async with app.run_test(): | ||
input_widget = app.query_one(Input) | ||
input_widget.action_cursor_left() | ||
input_widget.action_cursor_left() | ||
# We went left over two double-width characters | ||
assert app.cursor_position == Offset(17, 5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.