riched 0.4.3__tar.gz → 0.4.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.4.3 → riched-0.4.4}/PKG-INFO +8 -9
- {riched-0.4.3 → riched-0.4.4}/README.md +7 -8
- {riched-0.4.3 → riched-0.4.4}/pyproject.toml +1 -1
- {riched-0.4.3 → riched-0.4.4}/src/riched/cli.py +6 -5
- {riched-0.4.3 → riched-0.4.4}/tests/runner.py +6 -1
- {riched-0.4.3 → riched-0.4.4}/tests/test_cli.py +34 -0
- {riched-0.4.3 → riched-0.4.4}/uv.lock +1 -1
- {riched-0.4.3 → riched-0.4.4}/.gitignore +0 -0
- {riched-0.4.3 → riched-0.4.4}/.python-version +0 -0
- {riched-0.4.3 → riched-0.4.4}/AGENTS.md +0 -0
- {riched-0.4.3 → riched-0.4.4}/src/riched/__init__.py +0 -0
- {riched-0.4.3 → riched-0.4.4}/src/riched/app.py +0 -0
- {riched-0.4.3 → riched-0.4.4}/src/riched/bindings.yaml +0 -0
- {riched-0.4.3 → riched-0.4.4}/src/riched/editor.py +0 -0
- {riched-0.4.3 → riched-0.4.4}/src/riched/keybindings.py +0 -0
- {riched-0.4.3 → riched-0.4.4}/src/riched/quick_open.py +0 -0
- {riched-0.4.3 → riched-0.4.4}/src/riched/screens.py +0 -0
- {riched-0.4.3 → riched-0.4.4}/src/riched/settings.py +0 -0
- {riched-0.4.3 → riched-0.4.4}/src/riched/syntax.py +0 -0
- {riched-0.4.3 → riched-0.4.4}/tests/__init__.py +0 -0
- {riched-0.4.3 → riched-0.4.4}/tests/helpers.py +0 -0
- {riched-0.4.3 → riched-0.4.4}/tests/test_command_palette.py +0 -0
- {riched-0.4.3 → riched-0.4.4}/tests/test_dirty_buffers.py +0 -0
- {riched-0.4.3 → riched-0.4.4}/tests/test_editor_shortcuts.py +0 -0
- {riched-0.4.3 → riched-0.4.4}/tests/test_file_io.py +0 -0
- {riched-0.4.3 → riched-0.4.4}/tests/test_file_tree.py +0 -0
- {riched-0.4.3 → riched-0.4.4}/tests/test_footer.py +0 -0
- {riched-0.4.3 → riched-0.4.4}/tests/test_quick_open.py +0 -0
- {riched-0.4.3 → riched-0.4.4}/tests/test_syntax.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: riched
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.4
|
|
4
4
|
Summary: A Rich library powered editor(hence the name riched) that implements VS Code keybindings in TUI
|
|
5
5
|
Project-URL: Repository, https://github.com/hoishing/riched
|
|
6
6
|
Requires-Python: >=3.12
|
|
@@ -81,11 +81,10 @@ Editor shortcuts:
|
|
|
81
81
|
|
|
82
82
|
## Limitations
|
|
83
83
|
|
|
84
|
-
-
|
|
85
|
-
|
|
86
|
-
-
|
|
87
|
-
|
|
88
|
-
-
|
|
89
|
-
Ghostty
|
|
90
|
-
|
|
91
|
-
environments.
|
|
84
|
+
- [Textual](https://github.com/textualize/textual) textarea limitation:
|
|
85
|
+
- no multi-cursor editing
|
|
86
|
+
- no chord hotkey sequence such as `⌘K ⌘S`
|
|
87
|
+
|
|
88
|
+
- Ghostty conflicts:
|
|
89
|
+
- conflicted Ghostty hotkey. eg. `⌘Enter`, `⌘⇧Enter`, `⌘[`, `⌘]`, `⌘⇧P`, `⌘W`, `⌘Q`...etc
|
|
90
|
+
- won't implement features that require modifying Ghostty default config
|
|
@@ -70,11 +70,10 @@ Editor shortcuts:
|
|
|
70
70
|
|
|
71
71
|
## Limitations
|
|
72
72
|
|
|
73
|
-
-
|
|
74
|
-
|
|
75
|
-
-
|
|
76
|
-
|
|
77
|
-
-
|
|
78
|
-
Ghostty
|
|
79
|
-
|
|
80
|
-
environments.
|
|
73
|
+
- [Textual](https://github.com/textualize/textual) textarea limitation:
|
|
74
|
+
- no multi-cursor editing
|
|
75
|
+
- no chord hotkey sequence such as `⌘K ⌘S`
|
|
76
|
+
|
|
77
|
+
- Ghostty conflicts:
|
|
78
|
+
- conflicted Ghostty hotkey. eg. `⌘Enter`, `⌘⇧Enter`, `⌘[`, `⌘]`, `⌘⇧P`, `⌘W`, `⌘Q`...etc
|
|
79
|
+
- won't implement features that require modifying Ghostty default config
|
|
@@ -17,7 +17,11 @@ def main() -> int:
|
|
|
17
17
|
action="store_true",
|
|
18
18
|
help="Show the version and exit",
|
|
19
19
|
)
|
|
20
|
-
parser.add_argument(
|
|
20
|
+
parser.add_argument(
|
|
21
|
+
"filename",
|
|
22
|
+
nargs="?",
|
|
23
|
+
help="File or folder to open; defaults to the current folder",
|
|
24
|
+
)
|
|
21
25
|
args = parser.parse_args()
|
|
22
26
|
|
|
23
27
|
if args.version:
|
|
@@ -26,10 +30,7 @@ def main() -> int:
|
|
|
26
30
|
print(f"riched {version('riched')}")
|
|
27
31
|
return 0
|
|
28
32
|
|
|
29
|
-
if args.filename is None
|
|
30
|
-
parser.error("the following arguments are required: filename")
|
|
31
|
-
|
|
32
|
-
path = Path(args.filename).expanduser()
|
|
33
|
+
path = Path.cwd() if args.filename is None else Path(args.filename).expanduser()
|
|
33
34
|
root = path if path.is_dir() else Path.cwd()
|
|
34
35
|
|
|
35
36
|
class ConfiguredRichedApp(RichedApp):
|
|
@@ -11,7 +11,11 @@ from .test_command_palette import (
|
|
|
11
11
|
test_ctrl_p_does_not_open_command_palette,
|
|
12
12
|
test_f1_opens_command_palette,
|
|
13
13
|
)
|
|
14
|
-
from .test_cli import
|
|
14
|
+
from .test_cli import (
|
|
15
|
+
test_no_filename_opens_current_folder,
|
|
16
|
+
test_version_flag_prints_current_version,
|
|
17
|
+
test_version_flag_rejects_filename,
|
|
18
|
+
)
|
|
15
19
|
from .test_dirty_buffers import (
|
|
16
20
|
test_close_buffer_dirty_shows_wide_modal_then_cancel,
|
|
17
21
|
test_close_buffer_dirty_space_discard_enters_no_buffer_state,
|
|
@@ -96,6 +100,7 @@ TESTS: list[tuple[str, Callable[[], Awaitable[None]]]] = [
|
|
|
96
100
|
("open missing file", test_open_missing_file),
|
|
97
101
|
("open directory starts with no buffer", test_open_directory_starts_with_no_buffer),
|
|
98
102
|
("save writes file", test_save_writes_file),
|
|
103
|
+
("cli: no filename opens current folder", test_no_filename_opens_current_folder),
|
|
99
104
|
("cli: version flag prints current version", test_version_flag_prints_current_version),
|
|
100
105
|
("cli: version flag rejects filename", test_version_flag_rejects_filename),
|
|
101
106
|
("command palette: button hidden", test_command_palette_button_is_hidden),
|
|
@@ -2,7 +2,9 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import subprocess
|
|
4
4
|
import sys
|
|
5
|
+
import tempfile
|
|
5
6
|
from importlib.metadata import version
|
|
7
|
+
from pathlib import Path
|
|
6
8
|
|
|
7
9
|
|
|
8
10
|
async def test_version_flag_prints_current_version() -> None:
|
|
@@ -38,3 +40,35 @@ async def test_version_flag_rejects_filename() -> None:
|
|
|
38
40
|
assert result.returncode == 2, result.stdout
|
|
39
41
|
assert result.stdout == "", result.stdout
|
|
40
42
|
assert "riched --version does not take arguments" in result.stderr, result.stderr
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
async def test_no_filename_opens_current_folder() -> None:
|
|
46
|
+
script = """
|
|
47
|
+
from pathlib import Path
|
|
48
|
+
from riched import cli
|
|
49
|
+
|
|
50
|
+
captured = {}
|
|
51
|
+
|
|
52
|
+
class StubApp:
|
|
53
|
+
def __init__(self, path, root):
|
|
54
|
+
captured["path"] = path
|
|
55
|
+
captured["root"] = root
|
|
56
|
+
|
|
57
|
+
def run(self):
|
|
58
|
+
print(f"{captured['path']}|{captured['root']}")
|
|
59
|
+
|
|
60
|
+
cli.RichedApp = StubApp
|
|
61
|
+
raise SystemExit(cli.main())
|
|
62
|
+
"""
|
|
63
|
+
tmp = Path(tempfile.mkdtemp(prefix="riched-cli-"))
|
|
64
|
+
result = subprocess.run(
|
|
65
|
+
[sys.executable, "-c", script],
|
|
66
|
+
check=False,
|
|
67
|
+
capture_output=True,
|
|
68
|
+
text=True,
|
|
69
|
+
cwd=tmp,
|
|
70
|
+
)
|
|
71
|
+
cwd = tmp.resolve()
|
|
72
|
+
assert result.returncode == 0, result.stderr
|
|
73
|
+
assert result.stdout == f"{cwd}|{cwd}\n", result.stdout
|
|
74
|
+
assert result.stderr == "", result.stderr
|
|
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
|