riched 1.6.3__tar.gz → 1.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.
Files changed (40) hide show
  1. {riched-1.6.3 → riched-1.6.4}/PKG-INFO +15 -14
  2. {riched-1.6.3 → riched-1.6.4}/README.md +14 -13
  3. {riched-1.6.3 → riched-1.6.4}/pyproject.toml +1 -1
  4. {riched-1.6.3 → riched-1.6.4}/src/rich_editor/bindings.yaml +3 -2
  5. {riched-1.6.3 → riched-1.6.4}/tests/test_markdown_preview.py +29 -4
  6. {riched-1.6.3 → riched-1.6.4}/uv.lock +1 -1
  7. {riched-1.6.3 → riched-1.6.4}/.gitignore +0 -0
  8. {riched-1.6.3 → riched-1.6.4}/.python-version +0 -0
  9. {riched-1.6.3 → riched-1.6.4}/AGENTS.md +0 -0
  10. {riched-1.6.3 → riched-1.6.4}/docs/command-palette.svg +0 -0
  11. {riched-1.6.3 → riched-1.6.4}/docs/markdown-preview.svg +0 -0
  12. {riched-1.6.3 → riched-1.6.4}/docs/python-buffer.svg +0 -0
  13. {riched-1.6.3 → riched-1.6.4}/docs/search-replace.svg +0 -0
  14. {riched-1.6.3 → riched-1.6.4}/plans/esc-unified-sidebar-escape.md +0 -0
  15. {riched-1.6.3 → riched-1.6.4}/src/rich_editor/__init__.py +0 -0
  16. {riched-1.6.3 → riched-1.6.4}/src/rich_editor/app.py +0 -0
  17. {riched-1.6.3 → riched-1.6.4}/src/rich_editor/cli.py +0 -0
  18. {riched-1.6.3 → riched-1.6.4}/src/rich_editor/editor.py +0 -0
  19. {riched-1.6.3 → riched-1.6.4}/src/rich_editor/formatting.py +0 -0
  20. {riched-1.6.3 → riched-1.6.4}/src/rich_editor/keybindings.py +0 -0
  21. {riched-1.6.3 → riched-1.6.4}/src/rich_editor/quick_open.py +0 -0
  22. {riched-1.6.3 → riched-1.6.4}/src/rich_editor/screens.py +0 -0
  23. {riched-1.6.3 → riched-1.6.4}/src/rich_editor/settings.py +0 -0
  24. {riched-1.6.3 → riched-1.6.4}/src/rich_editor/syntax.py +0 -0
  25. {riched-1.6.3 → riched-1.6.4}/tests/__init__.py +0 -0
  26. {riched-1.6.3 → riched-1.6.4}/tests/helpers.py +0 -0
  27. {riched-1.6.3 → riched-1.6.4}/tests/runner.py +0 -0
  28. {riched-1.6.3 → riched-1.6.4}/tests/test_cli.py +0 -0
  29. {riched-1.6.3 → riched-1.6.4}/tests/test_command_palette.py +0 -0
  30. {riched-1.6.3 → riched-1.6.4}/tests/test_create_file.py +0 -0
  31. {riched-1.6.3 → riched-1.6.4}/tests/test_dirty_buffers.py +0 -0
  32. {riched-1.6.3 → riched-1.6.4}/tests/test_editor_shortcuts.py +0 -0
  33. {riched-1.6.3 → riched-1.6.4}/tests/test_file_io.py +0 -0
  34. {riched-1.6.3 → riched-1.6.4}/tests/test_footer.py +0 -0
  35. {riched-1.6.3 → riched-1.6.4}/tests/test_formatting.py +0 -0
  36. {riched-1.6.3 → riched-1.6.4}/tests/test_quick_open.py +0 -0
  37. {riched-1.6.3 → riched-1.6.4}/tests/test_refresh.py +0 -0
  38. {riched-1.6.3 → riched-1.6.4}/tests/test_replace.py +0 -0
  39. {riched-1.6.3 → riched-1.6.4}/tests/test_sidebar.py +0 -0
  40. {riched-1.6.3 → riched-1.6.4}/tests/test_syntax.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: riched
3
- Version: 1.6.3
3
+ Version: 1.6.4
4
4
  Summary: Terminal Editor with VS Code Keybindings
5
5
  Project-URL: Repository, https://github.com/hoishing/riched
6
6
  Requires-Python: >=3.12
@@ -82,17 +82,17 @@ Key bindings are generated from the YAML in `src/rich_editor/bindings.yaml`.
82
82
 
83
83
  App shortcuts:
84
84
 
85
- | Shortcut | Action |
86
- | ------------ | ----------------------- |
87
- | `⌘S` | Save |
88
- | `F1` | Command palette |
89
- | `⌘B` / `⌃B` | Toggle sidebar |
90
- | `⌘P` | Quick open |
91
- | `⌃H` | Replace |
92
- | `⌃N` | Create file |
93
- | `⌃⇧V` | Toggle Markdown preview |
94
- | `⌥⇧F` | Format document |
95
- | `⌘R` | Refresh |
85
+ | Shortcut | Action |
86
+ | ------------- | ----------------------- |
87
+ | `⌘S` | Save |
88
+ | `F1` | Command palette |
89
+ | `⌘B` / `⌃B` | Toggle sidebar |
90
+ | `⌘P` | Quick open |
91
+ | `⌃H` | Replace |
92
+ | `⌃N` | Create file |
93
+ | `⌘⇧V` / `⌃⇧V` | Toggle Markdown preview |
94
+ | `⌥⇧F` | Format document |
95
+ | `⌘R` | Refresh |
96
96
 
97
97
  Editor shortcuts:
98
98
 
@@ -137,7 +137,7 @@ Riched persists the selected Textual theme in `settings.yaml` under the user con
137
137
 
138
138
  ## Markdown Preview
139
139
 
140
- Use `⌃⇧V`, the `Preview` button in the footer, or `F1` → `Toggle Markdown preview` to toggle an in-terminal rendered preview for Markdown files. The preview uses the current editor buffer, so unsaved edits are shown without writing them to disk.
140
+ Use `⌘⇧V` (`⌃⇧V` if Ghostty still owns `⌘⇧V`), the `Preview` button in the footer, or `F1` → `Toggle Markdown preview` to toggle an in-terminal rendered preview for Markdown files. The preview uses the current editor buffer, so unsaved edits are shown without writing them to disk.
141
141
 
142
142
  When Markdown preview is open, the header shows a `☰` button on the right. Click it to show or hide the Markdown table of contents. The button is hidden while editing the text buffer.
143
143
 
@@ -201,7 +201,7 @@ On stock Ghostty, `⌘⌫` is delivered to terminal apps as `⌃U`, so Riched bi
201
201
 
202
202
  ### Ghostty hotkey conflicts
203
203
 
204
- - some hotkeys are bound by Ghostty by default. eg. `⌘Z`, `⌘⇧Z`, `⌘Enter`, `⌘⇧Enter`, `⌘[`, `⌘]`, `⌘W`, `⌘Q`...etc
204
+ - some hotkeys are bound by Ghostty by default. eg. `⌘Z`, `⌘⇧Z`, `⌘⇧V`, `⌘Enter`, `⌘⇧Enter`, `⌘[`, `⌘]`, `⌘W`, `⌘Q`...etc
205
205
  - Riched detects conflicted shortcuts at startup.
206
206
  - Conflicted shortcuts are hidden from the footer until they are unbound in Ghostty config, unless the command has another available alternative.
207
207
  - The key bindings popup marks conflicted shortcuts with `⚠️` and shows a Ghostty config reminder.
@@ -225,6 +225,7 @@ keybind = super+enter=unbind
225
225
  keybind = super+shift+enter=unbind
226
226
  keybind = super+z=unbind
227
227
  keybind = super+shift+z=unbind
228
+ keybind = super+shift+v=unbind
228
229
  ```
229
230
 
230
231
  Then reload Ghostty config with `⌘⇧,` or restart Ghostty. To inspect Ghostty's defaults before changing them:
@@ -67,17 +67,17 @@ Key bindings are generated from the YAML in `src/rich_editor/bindings.yaml`.
67
67
 
68
68
  App shortcuts:
69
69
 
70
- | Shortcut | Action |
71
- | ------------ | ----------------------- |
72
- | `⌘S` | Save |
73
- | `F1` | Command palette |
74
- | `⌘B` / `⌃B` | Toggle sidebar |
75
- | `⌘P` | Quick open |
76
- | `⌃H` | Replace |
77
- | `⌃N` | Create file |
78
- | `⌃⇧V` | Toggle Markdown preview |
79
- | `⌥⇧F` | Format document |
80
- | `⌘R` | Refresh |
70
+ | Shortcut | Action |
71
+ | ------------- | ----------------------- |
72
+ | `⌘S` | Save |
73
+ | `F1` | Command palette |
74
+ | `⌘B` / `⌃B` | Toggle sidebar |
75
+ | `⌘P` | Quick open |
76
+ | `⌃H` | Replace |
77
+ | `⌃N` | Create file |
78
+ | `⌘⇧V` / `⌃⇧V` | Toggle Markdown preview |
79
+ | `⌥⇧F` | Format document |
80
+ | `⌘R` | Refresh |
81
81
 
82
82
  Editor shortcuts:
83
83
 
@@ -122,7 +122,7 @@ Riched persists the selected Textual theme in `settings.yaml` under the user con
122
122
 
123
123
  ## Markdown Preview
124
124
 
125
- Use `⌃⇧V`, the `Preview` button in the footer, or `F1` → `Toggle Markdown preview` to toggle an in-terminal rendered preview for Markdown files. The preview uses the current editor buffer, so unsaved edits are shown without writing them to disk.
125
+ Use `⌘⇧V` (`⌃⇧V` if Ghostty still owns `⌘⇧V`), the `Preview` button in the footer, or `F1` → `Toggle Markdown preview` to toggle an in-terminal rendered preview for Markdown files. The preview uses the current editor buffer, so unsaved edits are shown without writing them to disk.
126
126
 
127
127
  When Markdown preview is open, the header shows a `☰` button on the right. Click it to show or hide the Markdown table of contents. The button is hidden while editing the text buffer.
128
128
 
@@ -186,7 +186,7 @@ On stock Ghostty, `⌘⌫` is delivered to terminal apps as `⌃U`, so Riched bi
186
186
 
187
187
  ### Ghostty hotkey conflicts
188
188
 
189
- - some hotkeys are bound by Ghostty by default. eg. `⌘Z`, `⌘⇧Z`, `⌘Enter`, `⌘⇧Enter`, `⌘[`, `⌘]`, `⌘W`, `⌘Q`...etc
189
+ - some hotkeys are bound by Ghostty by default. eg. `⌘Z`, `⌘⇧Z`, `⌘⇧V`, `⌘Enter`, `⌘⇧Enter`, `⌘[`, `⌘]`, `⌘W`, `⌘Q`...etc
190
190
  - Riched detects conflicted shortcuts at startup.
191
191
  - Conflicted shortcuts are hidden from the footer until they are unbound in Ghostty config, unless the command has another available alternative.
192
192
  - The key bindings popup marks conflicted shortcuts with `⚠️` and shows a Ghostty config reminder.
@@ -210,6 +210,7 @@ keybind = super+enter=unbind
210
210
  keybind = super+shift+enter=unbind
211
211
  keybind = super+z=unbind
212
212
  keybind = super+shift+z=unbind
213
+ keybind = super+shift+v=unbind
213
214
  ```
214
215
 
215
216
  Then reload Ghostty config with `⌘⇧,` or restart Ghostty. To inspect Ghostty's defaults before changing them:
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "riched"
3
- version = "1.6.3"
3
+ version = "1.6.4"
4
4
  description = "Terminal Editor with VS Code Keybindings"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -33,9 +33,10 @@ app:
33
33
  preferred_key: ctrl+n
34
34
  - name: toggle_markdown_preview
35
35
  description: Toggle Markdown preview
36
- key: ctrl+shift+v,shift+ctrl+v,ctrl+V,alt+shift+v,shift+alt+v,alt+shift+V,shift+alt+V,alt+v
37
- preferred_key: ctrl+shift+v
36
+ key: cmd+shift+v,shift+cmd+v,super+shift+v,shift+super+v,cmd+V,shift+cmd+V,super+V,shift+super+V,cmd+shift+V,super+shift+V,ctrl+shift+v,shift+ctrl+v,ctrl+V,alt+shift+v,shift+alt+v,alt+shift+V,shift+alt+V,alt+v
37
+ preferred_key: cmd+shift+v,shift+cmd+v,super+shift+v,shift+super+v
38
38
  display_keys:
39
+ - cmd+shift+v
39
40
  - ctrl+shift+v
40
41
  - name: format_document
41
42
  description: Format document
@@ -2,7 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  from textual.widgets import DirectoryTree, Markdown, MarkdownViewer, Static
4
4
 
5
- from .helpers import _editor, _file_app, _key_help_rows, _press
5
+ from .helpers import _directory_app, _editor, _file_app, _key_help_rows, _press
6
6
 
7
7
 
8
8
  async def test_markdown_preview_toggles_from_primary_key() -> None:
@@ -27,8 +27,19 @@ async def test_markdown_preview_toggles_from_primary_key() -> None:
27
27
 
28
28
 
29
29
  async def test_markdown_preview_opens_from_alias_keys() -> None:
30
- for key, name in (("cmd+shift+v", "README.md"), ("super+shift+v", "README.markdown")):
31
- _, _, app = _file_app(name, "# Title", root_is_tmp=True, edit_mode=True)
30
+ keys = (
31
+ "cmd+shift+v",
32
+ "shift+cmd+v",
33
+ "super+shift+v",
34
+ "shift+super+v",
35
+ "cmd+V",
36
+ "super+V",
37
+ "ctrl+shift+v",
38
+ "shift+ctrl+v",
39
+ "ctrl+V",
40
+ )
41
+ for key in keys:
42
+ _, _, app = _file_app("README.md", "# Title", root_is_tmp=True, edit_mode=True)
32
43
  async with app.run_test() as pilot:
33
44
  await pilot.pause()
34
45
  await _press(pilot, key)
@@ -85,6 +96,20 @@ async def test_markdown_preview_toc_button_only_shows_for_preview() -> None:
85
96
  assert toc_button.styles.display == "none"
86
97
 
87
98
 
99
+ async def test_markdown_preview_hotkeys_warn_without_open_buffer() -> None:
100
+ for key in ("cmd+shift+v", "super+shift+v", "ctrl+shift+v"):
101
+ _, app = _directory_app()
102
+ notifications: list[tuple[str, str | None]] = []
103
+ app.notify = lambda message, **kwargs: notifications.append(
104
+ (str(message), kwargs.get("severity"))
105
+ )
106
+ async with app.run_test() as pilot:
107
+ await pilot.pause()
108
+ await _press(pilot, key)
109
+ assert not list(app.query("#markdown-preview")), key
110
+ assert notifications == [("No file open", "warning")], key
111
+
112
+
88
113
  async def test_cmd_shift_v_warns_for_non_markdown_file() -> None:
89
114
  _, _, app = _file_app("notes.txt", "# Plain text", root_is_tmp=True)
90
115
  notifications: list[tuple[str, str | None]] = []
@@ -205,5 +230,5 @@ async def test_keys_help_warns_for_ghostty_conflicted_markdown_preview() -> None
205
230
  assert ("⚠️ ⌘⇧V / ⌃⇧V", "Toggle Markdown preview") in rows
206
231
  assert (
207
232
  app.screen.query_one(".binding-legend", Static).content
208
- == "⚠️ Unbind this shortcut in Ghostty config to use it in Riched."
233
+ == "⚠️ Unbind this shortcut in your terminal config to use it in Riched."
209
234
  )
@@ -187,7 +187,7 @@ wheels = [
187
187
 
188
188
  [[package]]
189
189
  name = "riched"
190
- version = "1.6.2"
190
+ version = "1.6.4"
191
191
  source = { editable = "." }
192
192
  dependencies = [
193
193
  { name = "pyyaml" },
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