riched 0.2.2__tar.gz → 0.3.0__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 (29) hide show
  1. {riched-0.2.2 → riched-0.3.0}/PKG-INFO +12 -4
  2. {riched-0.2.2 → riched-0.3.0}/README.md +10 -3
  3. {riched-0.2.2 → riched-0.3.0}/pyproject.toml +4 -1
  4. {riched-0.2.2 → riched-0.3.0}/src/riched/bindings.yaml +1 -1
  5. {riched-0.2.2 → riched-0.3.0}/src/riched/cli.py +12 -3
  6. {riched-0.2.2 → riched-0.3.0}/tests/runner.py +2 -1
  7. {riched-0.2.2 → riched-0.3.0}/tests/test_cli.py +18 -0
  8. {riched-0.2.2 → riched-0.3.0}/tests/test_file_io.py +1 -2
  9. {riched-0.2.2 → riched-0.3.0}/tests/test_footer.py +1 -1
  10. {riched-0.2.2 → riched-0.3.0}/uv.lock +1 -1
  11. {riched-0.2.2 → riched-0.3.0}/.gitignore +0 -0
  12. {riched-0.2.2 → riched-0.3.0}/.python-version +0 -0
  13. {riched-0.2.2 → riched-0.3.0}/AGENTS.md +0 -0
  14. {riched-0.2.2 → riched-0.3.0}/src/riched/__init__.py +0 -0
  15. {riched-0.2.2 → riched-0.3.0}/src/riched/app.py +0 -0
  16. {riched-0.2.2 → riched-0.3.0}/src/riched/editor.py +0 -0
  17. {riched-0.2.2 → riched-0.3.0}/src/riched/keybindings.py +0 -0
  18. {riched-0.2.2 → riched-0.3.0}/src/riched/quick_open.py +0 -0
  19. {riched-0.2.2 → riched-0.3.0}/src/riched/screens.py +0 -0
  20. {riched-0.2.2 → riched-0.3.0}/src/riched/settings.py +0 -0
  21. {riched-0.2.2 → riched-0.3.0}/src/riched/syntax.py +0 -0
  22. {riched-0.2.2 → riched-0.3.0}/tests/__init__.py +0 -0
  23. {riched-0.2.2 → riched-0.3.0}/tests/helpers.py +0 -0
  24. {riched-0.2.2 → riched-0.3.0}/tests/test_command_palette.py +0 -0
  25. {riched-0.2.2 → riched-0.3.0}/tests/test_dirty_buffers.py +0 -0
  26. {riched-0.2.2 → riched-0.3.0}/tests/test_editor_shortcuts.py +0 -0
  27. {riched-0.2.2 → riched-0.3.0}/tests/test_file_tree.py +0 -0
  28. {riched-0.2.2 → riched-0.3.0}/tests/test_quick_open.py +0 -0
  29. {riched-0.2.2 → riched-0.3.0}/tests/test_syntax.py +0 -0
@@ -1,7 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: riched
3
- Version: 0.2.2
3
+ Version: 0.3.0
4
4
  Summary: TUI editor with VSCode keybindigs
5
+ Project-URL: Repository, https://github.com/hoishing/riched
5
6
  Requires-Python: >=3.12
6
7
  Requires-Dist: pyyaml>=6.0.3
7
8
  Requires-Dist: textual[syntax]>=8.2.4
@@ -54,7 +55,7 @@ App shortcuts:
54
55
 
55
56
  | Shortcut | Action |
56
57
  | --- | --- |
57
- | `⌃S` | Save |
58
+ | `⌘S` | Save |
58
59
  | `⌃Q` | Quit |
59
60
  | `⌃W` | Close buffer |
60
61
  | `F1` | Key bindings |
@@ -90,6 +91,13 @@ config directory: `~/Library/Application Support/riched/settings.yaml`
90
91
  - File search prefers git-indexed files when available, follows symlinked files and directories, skips cache/build dependency folders, and caps indexing at 10,000 files.
91
92
  - Fuzzy ranking now prioritizes exact path and filename matches such as `.zshrc`.
92
93
 
93
- ## Won't Implemented
94
+ ## Limitations
94
95
 
95
- `riched` will not implement key bindings that require users to modify the Ghostty terminal configuration, since terminal-specific configuration makes shortcuts harder to document, test, and support consistently across environments.
96
+ - `riched` does not support multi-cursor editing because Textual `TextArea`
97
+ currently models one active cursor/selection.
98
+ - Some Command-key shortcuts can conflict with Ghostty or terminal-level
99
+ bindings, for example `⌘⇧P`, `⌘W`, and `⌘Q`.
100
+ - `riched` will not implement key bindings that require users to modify the
101
+ Ghostty terminal configuration, since terminal-specific configuration makes
102
+ shortcuts harder to document, test, and support consistently across
103
+ environments.
@@ -44,7 +44,7 @@ App shortcuts:
44
44
 
45
45
  | Shortcut | Action |
46
46
  | --- | --- |
47
- | `⌃S` | Save |
47
+ | `⌘S` | Save |
48
48
  | `⌃Q` | Quit |
49
49
  | `⌃W` | Close buffer |
50
50
  | `F1` | Key bindings |
@@ -80,6 +80,13 @@ config directory: `~/Library/Application Support/riched/settings.yaml`
80
80
  - File search prefers git-indexed files when available, follows symlinked files and directories, skips cache/build dependency folders, and caps indexing at 10,000 files.
81
81
  - Fuzzy ranking now prioritizes exact path and filename matches such as `.zshrc`.
82
82
 
83
- ## Won't Implemented
83
+ ## Limitations
84
84
 
85
- `riched` will not implement key bindings that require users to modify the Ghostty terminal configuration, since terminal-specific configuration makes shortcuts harder to document, test, and support consistently across environments.
85
+ - `riched` does not support multi-cursor editing because Textual `TextArea`
86
+ currently models one active cursor/selection.
87
+ - Some Command-key shortcuts can conflict with Ghostty or terminal-level
88
+ bindings, for example `⌘⇧P`, `⌘W`, and `⌘Q`.
89
+ - `riched` will not implement key bindings that require users to modify the
90
+ Ghostty terminal configuration, since terminal-specific configuration makes
91
+ shortcuts harder to document, test, and support consistently across
92
+ environments.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "riched"
3
- version = "0.2.2"
3
+ version = "0.3.0"
4
4
  description = "TUI editor with VSCode keybindigs"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -10,6 +10,9 @@ dependencies = [
10
10
  "tree-sitter-typescript>=0.23.2",
11
11
  ]
12
12
 
13
+ [project.urls]
14
+ Repository = "https://github.com/hoishing/riched"
15
+
13
16
  [project.scripts]
14
17
  riched = "riched.cli:main"
15
18
 
@@ -2,7 +2,7 @@ app:
2
2
  commands:
3
3
  - name: save
4
4
  description: Save
5
- key: ctrl+s
5
+ key: cmd+s,super+s
6
6
  - name: quit_check
7
7
  description: Quit
8
8
  key: ctrl+q
@@ -14,12 +14,21 @@ def main() -> int:
14
14
  )
15
15
  parser.add_argument(
16
16
  "--version",
17
- action="version",
18
- version=f"%(prog)s {version('riched')}",
17
+ action="store_true",
18
+ help="Show the version and exit",
19
19
  )
20
- parser.add_argument("filename", help="File to open (created on save if missing)")
20
+ parser.add_argument("filename", nargs="?", help="File to open (created on save if missing)")
21
21
  args = parser.parse_args()
22
22
 
23
+ if args.version:
24
+ if args.filename is not None:
25
+ parser.error("riched --version does not take arguments")
26
+ print(f"riched {version('riched')}")
27
+ return 0
28
+
29
+ if args.filename is None:
30
+ parser.error("the following arguments are required: filename")
31
+
23
32
  path = Path(args.filename).expanduser()
24
33
  root = path if path.is_dir() else Path.cwd()
25
34
 
@@ -8,7 +8,7 @@ from .test_command_palette import (
8
8
  test_command_palette_button_is_hidden,
9
9
  test_command_palette_omits_maximize,
10
10
  )
11
- from .test_cli import test_version_flag_prints_current_version
11
+ from .test_cli import test_version_flag_prints_current_version, test_version_flag_rejects_filename
12
12
  from .test_dirty_buffers import (
13
13
  test_close_buffer_clean_enters_no_buffer_state_via_ctrl_w,
14
14
  test_close_buffer_dirty_shows_wide_modal_then_cancel,
@@ -74,6 +74,7 @@ TESTS: list[tuple[str, Callable[[], Awaitable[None]]]] = [
74
74
  ("open directory starts with no buffer", test_open_directory_starts_with_no_buffer),
75
75
  ("save writes file", test_save_writes_file),
76
76
  ("cli: version flag prints current version", test_version_flag_prints_current_version),
77
+ ("cli: version flag rejects filename", test_version_flag_rejects_filename),
77
78
  ("command palette: button hidden", test_command_palette_button_is_hidden),
78
79
  ("command palette: omit maximize", test_command_palette_omits_maximize),
79
80
  ("quit clean exits", test_quit_clean_exits),
@@ -20,3 +20,21 @@ async def test_version_flag_prints_current_version() -> None:
20
20
  assert result.returncode == 0, result.stderr
21
21
  assert result.stdout == f"riched {version('riched')}\n", result.stdout
22
22
  assert result.stderr == "", result.stderr
23
+
24
+
25
+ async def test_version_flag_rejects_filename() -> None:
26
+ result = subprocess.run(
27
+ [
28
+ sys.executable,
29
+ "-c",
30
+ "from riched.cli import main; raise SystemExit(main())",
31
+ "--version",
32
+ "notes.txt",
33
+ ],
34
+ check=False,
35
+ capture_output=True,
36
+ text=True,
37
+ )
38
+ assert result.returncode == 2, result.stdout
39
+ assert result.stdout == "", result.stdout
40
+ assert "riched --version does not take arguments" in result.stderr, result.stderr
@@ -58,7 +58,6 @@ async def test_save_writes_file() -> None:
58
58
  await pilot.pause()
59
59
  app.query_one("#editor", TextArea).load_text("typed content")
60
60
  await pilot.pause()
61
- await pilot.press("ctrl+s")
61
+ await pilot.press("cmd+s")
62
62
  await pilot.pause()
63
63
  assert f.read_text() == "typed content"
64
-
@@ -18,7 +18,7 @@ async def test_footer_uses_macos_modifier_symbols() -> None:
18
18
  for child in footer.children
19
19
  if hasattr(child, "key_display")
20
20
  }
21
- assert labels["Save"] == "S"
21
+ assert labels["Save"] == "S"
22
22
  assert labels["Close buffer"] == "⌃W"
23
23
  assert labels["Toggle file tree"] == "⌘B"
24
24
  assert labels["Quick open"] == "⌘P"
@@ -131,7 +131,7 @@ wheels = [
131
131
 
132
132
  [[package]]
133
133
  name = "riched"
134
- version = "0.2.2"
134
+ version = "0.3.0"
135
135
  source = { editable = "." }
136
136
  dependencies = [
137
137
  { 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