1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
[package]
# The crate is `mojibake-editor` because `mojibake` was already taken on
# crates.io by an unrelated encoder. The binary is `moji` and the library
# target is `mojibake`, so neither the command nor `use mojibake::…` carries
# the suffix.
name = "mojibake-editor"
version = "0.0.1"
edition = "2024"
# Let-chains (`if let ... && let ...`) are the binding constraint; they
# stabilised in 1.88. Edition 2024 alone would only need 1.85.
rust-version = "1.88"
description = "文字化け — a terminal text editor with Helix-style modal editing"
authors = ["rottedfm <rottedfm@proton.me>"]
license = "BSD-2-Clause"
readme = "README.md"
build = "build.rs"
repository = "https://git.mojibake.wiki/repos/mojibake"
keywords = ["editor", "terminal", "tui", "modal", "helix"]
categories = ["text-editors", "command-line-utilities"]
# Development-only files that need not ship in a published tarball.
exclude = [".envrc", ".gitmessage", "scripts/"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "mojibake"
path = "src/lib.rs"
[[bin]]
name = "moji"
path = "src/main.rs"
[dependencies]
better-panic = "0.3.0"
clap = { version = "4.6.1", features = [
"derive",
"cargo",
"wrap_help",
"unicode",
"string",
"unstable-styles",
] }
color-eyre = "0.6.5"
# default-features = false drops json5/yaml/ini from the dependency tree entirely;
# TOML is the only configuration format mojibake accepts. See MJB-HLR-014.
config = { version = "0.15.25", default-features = false, features = ["toml"] }
crossterm = { version = "0.29.0", features = ["serde", "event-stream"] }
directories = "6.0.0"
encoding_rs = "0.8"
encoding_rs_io = "0.1"
futures = "0.3.32"
human-panic = "2.0.8"
libc = "0.2.186"
ratatui = { version = "0.30.2", features = ["serde", "macros"] }
# Byte-indexed by design: `metric_chars` is deliberately NOT enabled.
#
# Pinned with `=` rather than the default caret requirement. This is a
# pre-release under a DAL-C classification, and a caret requirement would
# silently accept a later beta whose behaviour has not been verified against
# our requirements. See docs/reviews/library-selection.md (MJB-DR-006).
ropey = "=2.0.0-beta.1"
serde = { version = "1.0.228", features = ["derive"] }
signal-hook = "0.4.4"
strip-ansi-escapes = "0.2.1"
strum = { version = "0.28.0", features = ["derive"] }
thiserror = "2"
tokio = { version = "1.52.3", features = ["full"] }
tokio-util = "0.7.18"
toml = "1.1"
tracing = "0.1.44"
tracing-error = "0.2.1"
tracing-subscriber = { version = "0.3.23", features = ["env-filter", "serde"] }
unicode-segmentation = "1.13"
unicode-width = "0.2"
[dev-dependencies]
pretty_assertions = "1.4.1"
tempfile = "3"
[build-dependencies]
anyhow = "1.0.103"
gix = { version = "0.86", default-features = false, features = ["max-performance-safe"] }
vergen-gix = { version = "10.0.1", features = ["build", "cargo"] }
# Read the optimization guideline for more details: https://ratatui.rs/recipes/apps/release-your-app/#optimizations
[profile.release]
codegen-units = 1
lto = true
opt-level = "s"
strip = true
|