riched 1.7.0__tar.gz → 1.7.2__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-1.7.0 → riched-1.7.2}/PKG-INFO +3 -7
- {riched-1.7.0 → riched-1.7.2}/README.md +2 -6
- {riched-1.7.0 → riched-1.7.2}/pyproject.toml +1 -1
- {riched-1.7.0 → riched-1.7.2}/src/rich_editor/bindings.yaml +4 -11
- {riched-1.7.0 → riched-1.7.2}/src/rich_editor/editor.py +0 -16
- {riched-1.7.0 → riched-1.7.2}/tests/test_command_palette.py +0 -2
- {riched-1.7.0 → riched-1.7.2}/tests/test_editor_shortcuts.py +0 -16
- {riched-1.7.0 → riched-1.7.2}/tests/test_file_io.py +9 -8
- {riched-1.7.0 → riched-1.7.2}/uv.lock +1 -1
- {riched-1.7.0 → riched-1.7.2}/.gitignore +0 -0
- {riched-1.7.0 → riched-1.7.2}/.python-version +0 -0
- {riched-1.7.0 → riched-1.7.2}/AGENTS.md +0 -0
- {riched-1.7.0 → riched-1.7.2}/docs/command-palette.svg +0 -0
- {riched-1.7.0 → riched-1.7.2}/docs/markdown-preview.svg +0 -0
- {riched-1.7.0 → riched-1.7.2}/docs/python-buffer.svg +0 -0
- {riched-1.7.0 → riched-1.7.2}/docs/search-replace.svg +0 -0
- {riched-1.7.0 → riched-1.7.2}/plans/esc-unified-sidebar-escape.md +0 -0
- {riched-1.7.0 → riched-1.7.2}/src/rich_editor/__init__.py +0 -0
- {riched-1.7.0 → riched-1.7.2}/src/rich_editor/app.py +0 -0
- {riched-1.7.0 → riched-1.7.2}/src/rich_editor/cli.py +0 -0
- {riched-1.7.0 → riched-1.7.2}/src/rich_editor/formatting.py +0 -0
- {riched-1.7.0 → riched-1.7.2}/src/rich_editor/keybindings.py +0 -0
- {riched-1.7.0 → riched-1.7.2}/src/rich_editor/quick_open.py +0 -0
- {riched-1.7.0 → riched-1.7.2}/src/rich_editor/screens.py +0 -0
- {riched-1.7.0 → riched-1.7.2}/src/rich_editor/settings.py +0 -0
- {riched-1.7.0 → riched-1.7.2}/src/rich_editor/syntax.py +0 -0
- {riched-1.7.0 → riched-1.7.2}/tests/__init__.py +0 -0
- {riched-1.7.0 → riched-1.7.2}/tests/helpers.py +0 -0
- {riched-1.7.0 → riched-1.7.2}/tests/runner.py +0 -0
- {riched-1.7.0 → riched-1.7.2}/tests/test_cli.py +0 -0
- {riched-1.7.0 → riched-1.7.2}/tests/test_create_file.py +0 -0
- {riched-1.7.0 → riched-1.7.2}/tests/test_dirty_buffers.py +0 -0
- {riched-1.7.0 → riched-1.7.2}/tests/test_footer.py +0 -0
- {riched-1.7.0 → riched-1.7.2}/tests/test_formatting.py +0 -0
- {riched-1.7.0 → riched-1.7.2}/tests/test_markdown_preview.py +0 -0
- {riched-1.7.0 → riched-1.7.2}/tests/test_quick_open.py +0 -0
- {riched-1.7.0 → riched-1.7.2}/tests/test_refresh.py +0 -0
- {riched-1.7.0 → riched-1.7.2}/tests/test_replace.py +0 -0
- {riched-1.7.0 → riched-1.7.2}/tests/test_select_to_copy.py +0 -0
- {riched-1.7.0 → riched-1.7.2}/tests/test_sidebar.py +0 -0
- {riched-1.7.0 → riched-1.7.2}/tests/test_syntax.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: riched
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.2
|
|
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
|
|
@@ -85,7 +85,7 @@ App shortcuts:
|
|
|
85
85
|
|
|
86
86
|
| Shortcut | Action |
|
|
87
87
|
| ------------- | ----------------------- |
|
|
88
|
-
| `⌘S`
|
|
88
|
+
| `⌘S` / `⌃S` | Save |
|
|
89
89
|
| `F1` | Command palette |
|
|
90
90
|
| `⌘B` / `⌃B` | Toggle sidebar |
|
|
91
91
|
| `⌘P` | Quick open |
|
|
@@ -103,8 +103,6 @@ Editor shortcuts:
|
|
|
103
103
|
| `⌥↓` | Move line down |
|
|
104
104
|
| `⌥⇧↑` | Copy line up |
|
|
105
105
|
| `⌥⇧↓` | Copy line down |
|
|
106
|
-
| `⌘Enter` | Insert line below |
|
|
107
|
-
| `⌘⇧Enter` | Insert line above |
|
|
108
106
|
| `⌘]` | Indent line |
|
|
109
107
|
| `⌘[` | Outdent line |
|
|
110
108
|
| `⌥⌫` | Delete word left |
|
|
@@ -204,7 +202,7 @@ On stock Ghostty, `⌘⌫` is delivered to terminal apps as `⌃U`, so Riched bi
|
|
|
204
202
|
|
|
205
203
|
### Ghostty hotkey conflicts
|
|
206
204
|
|
|
207
|
-
- some hotkeys are bound by Ghostty by default. eg. `⌘Z`, `⌘⇧Z`, `⌘⇧V`, `⌘
|
|
205
|
+
- some hotkeys are bound by Ghostty by default. eg. `⌘Z`, `⌘⇧Z`, `⌘⇧V`, `⌘[`, `⌘]`, `⌘W`, `⌘Q`...etc
|
|
208
206
|
- Riched detects conflicted shortcuts at startup.
|
|
209
207
|
- Conflicted shortcuts are hidden from the footer until they are unbound in Ghostty config, unless the command has another available alternative.
|
|
210
208
|
- The key bindings popup marks conflicted shortcuts with `⚠️` and shows a Ghostty config reminder.
|
|
@@ -224,8 +222,6 @@ Add one `keybind = <trigger>=unbind` line per conflicted shortcut you want to us
|
|
|
224
222
|
```conf
|
|
225
223
|
keybind = super+[=unbind
|
|
226
224
|
keybind = super+]=unbind
|
|
227
|
-
keybind = super+enter=unbind
|
|
228
|
-
keybind = super+shift+enter=unbind
|
|
229
225
|
keybind = super+z=unbind
|
|
230
226
|
keybind = super+shift+z=unbind
|
|
231
227
|
keybind = super+shift+v=unbind
|
|
@@ -70,7 +70,7 @@ App shortcuts:
|
|
|
70
70
|
|
|
71
71
|
| Shortcut | Action |
|
|
72
72
|
| ------------- | ----------------------- |
|
|
73
|
-
| `⌘S`
|
|
73
|
+
| `⌘S` / `⌃S` | Save |
|
|
74
74
|
| `F1` | Command palette |
|
|
75
75
|
| `⌘B` / `⌃B` | Toggle sidebar |
|
|
76
76
|
| `⌘P` | Quick open |
|
|
@@ -88,8 +88,6 @@ Editor shortcuts:
|
|
|
88
88
|
| `⌥↓` | Move line down |
|
|
89
89
|
| `⌥⇧↑` | Copy line up |
|
|
90
90
|
| `⌥⇧↓` | Copy line down |
|
|
91
|
-
| `⌘Enter` | Insert line below |
|
|
92
|
-
| `⌘⇧Enter` | Insert line above |
|
|
93
91
|
| `⌘]` | Indent line |
|
|
94
92
|
| `⌘[` | Outdent line |
|
|
95
93
|
| `⌥⌫` | Delete word left |
|
|
@@ -189,7 +187,7 @@ On stock Ghostty, `⌘⌫` is delivered to terminal apps as `⌃U`, so Riched bi
|
|
|
189
187
|
|
|
190
188
|
### Ghostty hotkey conflicts
|
|
191
189
|
|
|
192
|
-
- some hotkeys are bound by Ghostty by default. eg. `⌘Z`, `⌘⇧Z`, `⌘⇧V`, `⌘
|
|
190
|
+
- some hotkeys are bound by Ghostty by default. eg. `⌘Z`, `⌘⇧Z`, `⌘⇧V`, `⌘[`, `⌘]`, `⌘W`, `⌘Q`...etc
|
|
193
191
|
- Riched detects conflicted shortcuts at startup.
|
|
194
192
|
- Conflicted shortcuts are hidden from the footer until they are unbound in Ghostty config, unless the command has another available alternative.
|
|
195
193
|
- The key bindings popup marks conflicted shortcuts with `⚠️` and shows a Ghostty config reminder.
|
|
@@ -209,8 +207,6 @@ Add one `keybind = <trigger>=unbind` line per conflicted shortcut you want to us
|
|
|
209
207
|
```conf
|
|
210
208
|
keybind = super+[=unbind
|
|
211
209
|
keybind = super+]=unbind
|
|
212
|
-
keybind = super+enter=unbind
|
|
213
|
-
keybind = super+shift+enter=unbind
|
|
214
210
|
keybind = super+z=unbind
|
|
215
211
|
keybind = super+shift+z=unbind
|
|
216
212
|
keybind = super+shift+v=unbind
|
|
@@ -2,7 +2,10 @@ app:
|
|
|
2
2
|
commands:
|
|
3
3
|
- name: save
|
|
4
4
|
description: Save
|
|
5
|
-
key: cmd+s,super+s
|
|
5
|
+
key: cmd+s,super+s,ctrl+s
|
|
6
|
+
display_keys:
|
|
7
|
+
- cmd+s
|
|
8
|
+
- ctrl+s
|
|
6
9
|
- name: command_palette
|
|
7
10
|
description: Command palette
|
|
8
11
|
key: f1
|
|
@@ -63,16 +66,6 @@ editor:
|
|
|
63
66
|
action: copy_line_down
|
|
64
67
|
description: Copy line down
|
|
65
68
|
show: false
|
|
66
|
-
- key: cmd+enter,super+enter
|
|
67
|
-
preferred_key: cmd+enter,super+enter
|
|
68
|
-
action: insert_line_below
|
|
69
|
-
description: Insert line below
|
|
70
|
-
show: false
|
|
71
|
-
- key: cmd+shift+enter,shift+cmd+enter,super+shift+enter,shift+super+enter
|
|
72
|
-
preferred_key: cmd+shift+enter,shift+cmd+enter,super+shift+enter,shift+super+enter
|
|
73
|
-
action: insert_line_above
|
|
74
|
-
description: Insert line above
|
|
75
|
-
show: false
|
|
76
69
|
- key: cmd+],super+],cmd+right_square_bracket,super+right_square_bracket
|
|
77
70
|
preferred_key: cmd+],super+]
|
|
78
71
|
action: indent_line
|
|
@@ -158,22 +158,6 @@ class RichedTextArea(TextArea):
|
|
|
158
158
|
self.insert(line + "\n", (row, 0), maintain_selection_offset=False)
|
|
159
159
|
self.move_cursor((row, col))
|
|
160
160
|
|
|
161
|
-
def action_insert_line_below(self) -> None:
|
|
162
|
-
self._insert_blank_line(1)
|
|
163
|
-
|
|
164
|
-
def action_insert_line_above(self) -> None:
|
|
165
|
-
self._insert_blank_line(-1)
|
|
166
|
-
|
|
167
|
-
def _insert_blank_line(self, direction: int) -> None:
|
|
168
|
-
row, _col = self.cursor_location
|
|
169
|
-
if direction > 0:
|
|
170
|
-
line = self.document.get_line(row)
|
|
171
|
-
self.insert("\n", (row, len(line)), maintain_selection_offset=False)
|
|
172
|
-
self.move_cursor((row + 1, 0))
|
|
173
|
-
else:
|
|
174
|
-
self.insert("\n", (row, 0), maintain_selection_offset=False)
|
|
175
|
-
self.move_cursor((row, 0))
|
|
176
|
-
|
|
177
161
|
def action_indent_line(self) -> None:
|
|
178
162
|
self._shift_target_line_indent(2)
|
|
179
163
|
|
|
@@ -159,8 +159,6 @@ async def test_keys_help_includes_command_palette_binding() -> None:
|
|
|
159
159
|
|
|
160
160
|
rows = _key_help_rows(app)
|
|
161
161
|
assert ("F1", "Command palette") in rows
|
|
162
|
-
assert ("⌘Enter", "Insert line below") in rows
|
|
163
|
-
assert ("⌘⇧Enter", "Insert line above") in rows
|
|
164
162
|
assert ("⌘]", "Indent line") in rows
|
|
165
163
|
assert ("⌘[", "Outdent line") in rows
|
|
166
164
|
assert ("⌥⇧F", "Format document") in rows
|
|
@@ -87,22 +87,6 @@ async def test_copy_line_shortcuts() -> None:
|
|
|
87
87
|
)
|
|
88
88
|
|
|
89
89
|
|
|
90
|
-
async def test_insert_line_aliases() -> None:
|
|
91
|
-
cases = (
|
|
92
|
-
(("cmd+enter", "super+enter"), (0, 2)),
|
|
93
|
-
(("cmd+shift+enter", "super+shift+enter"), (1, 2)),
|
|
94
|
-
)
|
|
95
|
-
for keys, cursor in cases:
|
|
96
|
-
for key in keys:
|
|
97
|
-
await _run_editor_case(
|
|
98
|
-
key=key,
|
|
99
|
-
content="aaa\nbbb",
|
|
100
|
-
cursor=cursor,
|
|
101
|
-
expected_text="aaa\n\nbbb",
|
|
102
|
-
expected_cursor=(1, 0),
|
|
103
|
-
)
|
|
104
|
-
|
|
105
|
-
|
|
106
90
|
async def test_indent_and_outdent_aliases() -> None:
|
|
107
91
|
cases = (
|
|
108
92
|
(
|
|
@@ -43,11 +43,12 @@ async def test_open_directory_starts_with_no_buffer() -> None:
|
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
async def test_save_writes_file() -> None:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
for key in ("cmd+s", "super+s", "ctrl+s"):
|
|
47
|
+
_, f, app = _file_app("out.txt")
|
|
48
|
+
async with app.run_test() as pilot:
|
|
49
|
+
await pilot.pause()
|
|
50
|
+
_editor(app).load_text(f"typed content {key}")
|
|
51
|
+
await pilot.pause()
|
|
52
|
+
await pilot.press(key)
|
|
53
|
+
await pilot.pause()
|
|
54
|
+
assert f.read_text() == f"typed content {key}", key
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|