riched 0.6.2__tar.gz → 0.6.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {riched-0.6.2 → riched-0.6.4}/AGENTS.md +1 -0
- {riched-0.6.2 → riched-0.6.4}/PKG-INFO +1 -1
- {riched-0.6.2 → riched-0.6.4}/pyproject.toml +1 -1
- {riched-0.6.2 → riched-0.6.4}/src/riched/app.py +15 -0
- {riched-0.6.2 → riched-0.6.4}/tests/test_markdown_preview.py +17 -1
- {riched-0.6.2 → riched-0.6.4}/uv.lock +1 -1
- {riched-0.6.2 → riched-0.6.4}/.gitignore +0 -0
- {riched-0.6.2 → riched-0.6.4}/.python-version +0 -0
- {riched-0.6.2 → riched-0.6.4}/README.md +0 -0
- {riched-0.6.2 → riched-0.6.4}/src/riched/__init__.py +0 -0
- {riched-0.6.2 → riched-0.6.4}/src/riched/bindings.yaml +0 -0
- {riched-0.6.2 → riched-0.6.4}/src/riched/cli.py +0 -0
- {riched-0.6.2 → riched-0.6.4}/src/riched/editor.py +0 -0
- {riched-0.6.2 → riched-0.6.4}/src/riched/formatting.py +0 -0
- {riched-0.6.2 → riched-0.6.4}/src/riched/keybindings.py +0 -0
- {riched-0.6.2 → riched-0.6.4}/src/riched/quick_open.py +0 -0
- {riched-0.6.2 → riched-0.6.4}/src/riched/screens.py +0 -0
- {riched-0.6.2 → riched-0.6.4}/src/riched/settings.py +0 -0
- {riched-0.6.2 → riched-0.6.4}/src/riched/syntax.py +0 -0
- {riched-0.6.2 → riched-0.6.4}/tests/__init__.py +0 -0
- {riched-0.6.2 → riched-0.6.4}/tests/helpers.py +0 -0
- {riched-0.6.2 → riched-0.6.4}/tests/runner.py +0 -0
- {riched-0.6.2 → riched-0.6.4}/tests/test_cli.py +0 -0
- {riched-0.6.2 → riched-0.6.4}/tests/test_command_palette.py +0 -0
- {riched-0.6.2 → riched-0.6.4}/tests/test_dirty_buffers.py +0 -0
- {riched-0.6.2 → riched-0.6.4}/tests/test_editor_shortcuts.py +0 -0
- {riched-0.6.2 → riched-0.6.4}/tests/test_file_io.py +0 -0
- {riched-0.6.2 → riched-0.6.4}/tests/test_file_tree.py +0 -0
- {riched-0.6.2 → riched-0.6.4}/tests/test_footer.py +0 -0
- {riched-0.6.2 → riched-0.6.4}/tests/test_formatting.py +0 -0
- {riched-0.6.2 → riched-0.6.4}/tests/test_quick_open.py +0 -0
- {riched-0.6.2 → riched-0.6.4}/tests/test_syntax.py +0 -0
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
- check if a hotkey is bounded with Ghostty built-in hotkey before adding any new key binding. Add startup detection for Ghostty-conflicted hotkeys and document any alternative hotkeys as alternatives.
|
|
4
4
|
- riched only supports Ghostty on macOS. For every new hotkey or alternative, verify the real Ghostty/Textual terminal path, not only Textual Pilot's synthetic key name. Use `ghostty +list-keybinds --default` to check Ghostty interception, then inspect Textual's ANSI mapping with `uv run python` when the key uses Ctrl punctuation or other ambiguous terminal sequences. Add e2e coverage for both the requested human spelling and the real Textual key name when they differ, for example `ctrl+right_square_bracket` for real terminal Ctrl+]. Do not use alternatives that collapse to `escape` or another existing semantic key; Ctrl+[ is Escape in terminal input and must not be used as a distinct alternative.
|
|
5
|
+
- automatically commit, push, build and publish the package after bumping the package version
|
|
5
6
|
|
|
6
7
|
## Project Structure & Module Organization
|
|
7
8
|
|
|
@@ -227,6 +227,11 @@ class FileTreeResizeHandle(Static):
|
|
|
227
227
|
class RichedMarkdownViewer(MarkdownViewer):
|
|
228
228
|
"""Markdown preview that opens external URLs without navigating to them."""
|
|
229
229
|
|
|
230
|
+
BINDINGS = [
|
|
231
|
+
*MarkdownViewer.BINDINGS,
|
|
232
|
+
Binding("escape", "focus_file_tree", "Focus file tree", show=False),
|
|
233
|
+
]
|
|
234
|
+
|
|
230
235
|
async def go(self, location: str | Any) -> None:
|
|
231
236
|
href = str(location)
|
|
232
237
|
parsed = urlparse(href)
|
|
@@ -235,6 +240,11 @@ class RichedMarkdownViewer(MarkdownViewer):
|
|
|
235
240
|
return
|
|
236
241
|
await super().go(location)
|
|
237
242
|
|
|
243
|
+
def action_focus_file_tree(self) -> None:
|
|
244
|
+
app = self.app
|
|
245
|
+
if isinstance(app, RichedApp):
|
|
246
|
+
app.action_focus_file_tree()
|
|
247
|
+
|
|
238
248
|
|
|
239
249
|
class RichedApp(App):
|
|
240
250
|
"""TUI text editor with a project file tree."""
|
|
@@ -764,3 +774,8 @@ class RichedApp(App):
|
|
|
764
774
|
editor.focus()
|
|
765
775
|
return
|
|
766
776
|
tree.focus()
|
|
777
|
+
|
|
778
|
+
def action_focus_file_tree(self) -> None:
|
|
779
|
+
if not self._is_file_tree_visible():
|
|
780
|
+
self._show_file_tree()
|
|
781
|
+
self._file_tree().focus()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from textual.widgets import Markdown, MarkdownViewer, Static
|
|
3
|
+
from textual.widgets import DirectoryTree, Markdown, MarkdownViewer, Static
|
|
4
4
|
|
|
5
5
|
from .helpers import _editor, _file_app, _key_help_rows, _press
|
|
6
6
|
|
|
@@ -113,6 +113,22 @@ async def test_markdown_preview_external_link_opens_without_navigation() -> None
|
|
|
113
113
|
assert preview.document.source == "[Rich](https://github.com/Textualize/rich)"
|
|
114
114
|
|
|
115
115
|
|
|
116
|
+
async def test_markdown_preview_escape_focuses_file_tree() -> None:
|
|
117
|
+
_, _, app = _file_app("README.md", "# Title", root_is_tmp=True)
|
|
118
|
+
async with app.run_test() as pilot:
|
|
119
|
+
await pilot.pause()
|
|
120
|
+
|
|
121
|
+
await _press(pilot, "cmd+shift+v")
|
|
122
|
+
preview = app.query_one("#markdown-preview", MarkdownViewer)
|
|
123
|
+
tree = app.query_one("#file-tree", DirectoryTree)
|
|
124
|
+
assert preview.document.has_focus
|
|
125
|
+
|
|
126
|
+
await _press(pilot, "escape")
|
|
127
|
+
|
|
128
|
+
assert tree.has_focus
|
|
129
|
+
assert app.query_one("#markdown-preview", MarkdownViewer)
|
|
130
|
+
|
|
131
|
+
|
|
116
132
|
async def test_keys_help_includes_markdown_preview_binding() -> None:
|
|
117
133
|
_, _, app = _file_app(
|
|
118
134
|
"README.md",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|