Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies = [
"nbformat>=5.10.4",
"pyvips[binary]>=3.0.0",
"textual-image[textual]>=0.8.1",
"textual[syntax]>=3.7.1",
"textual[syntax]>=6.6.0",
]

[project.urls]
Expand Down
2 changes: 1 addition & 1 deletion src/netbook/_text_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def estimate_height(self) -> int:
assert self.styles.max_height.is_cells
return min(
self.styles.max_height.value,
len(str(self.contents.renderable).splitlines())
len(str(self.contents.content).splitlines())
+ self.styles.border.spacing.top
+ self.styles.border.spacing.bottom,
)
Expand Down
16 changes: 8 additions & 8 deletions tests/test_find.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,37 @@ async def test_find(pilot_nb: textual.pilot.Pilot):

await pilot_nb.press(*list(".Display"))
await pilot_nb.pause()
assert app.find.text._content == " 1 of 2 "
assert app.find.text.content == " 1 of 2 "

await pilot_nb.press("enter")
await pilot_nb.pause()
assert app.find.text._content == " 2 of 2 "
assert app.find.text.content == " 2 of 2 "

await pilot_nb.press("shift+enter")
await pilot_nb.pause()
assert app.find.text._content == " 1 of 2 "
assert app.find.text.content == " 1 of 2 "

await pilot_nb.click(app.find.regular_expression)
await pilot_nb.pause()
assert app.find.text._content == " 1 of 3 "
assert app.find.text.content == " 1 of 3 "

# Test malformed regular expression
await pilot_nb.press("[")
await pilot_nb.pause()
assert app.find.text._content == "Not Found"
assert app.find.text.content == "Not Found"

# Change back
await pilot_nb.press("backspace")
await pilot_nb.pause()
assert app.find.text._content == " 1 of 3 "
assert app.find.text.content == " 1 of 3 "

await pilot_nb.click(app.find.whole_word)
await pilot_nb.pause()
assert app.find.text._content == " 1 of 2 "
assert app.find.text.content == " 1 of 2 "

await pilot_nb.click(app.find.match_case)
await pilot_nb.pause()
assert app.find.text._content == "Not Found"
assert app.find.text.content == "Not Found"

await pilot_nb.press("escape")
await pilot_nb.pause()
Expand Down
Loading