jj/cli
Yuya Nishihara 0656409904 templater: make .substr() be byte-index based, round towards origin
I'm going to add string.len() method which will return a length in bytes. The
number of the UTF-8 code points is useless metrics, and strings here are often
ASCII bytes, so let's simply use byte indices in substr().

If the given index is not at a char boundary, it will be rounded. I considered
making it an error, but that would be annoying. I would want to see something
printed by author.name().substr() even if it contained latin characters.

I've extracted index normalization function which might be used by other string
methods. The remaining part of substr() is trivial, so inlined it.
2024-03-01 08:51:20 +09:00
..
examples Switch to ignore crate for gitignore handling. 2024-02-20 09:12:46 -08:00
src templater: make .substr() be byte-index based, round towards origin 2024-03-01 08:51:20 +09:00
testing revset: ad-hoc optimization for range queries containing unwanted wanted heads 2024-02-22 23:26:29 +09:00
tests cli: don't ignore 'diff --tool=:builtin', report error 2024-03-01 08:51:06 +09:00
build.rs build: update rerun-if conditions to watch .git/HEAD in colocated repo 2023-08-06 12:16:11 +09:00
Cargo.toml templater: add similarity hint to no such method/keyword errors 2024-02-28 09:03:04 +09:00
LICENSE cargo: add LICENSE file to each crate we publish 2023-09-22 21:48:28 -07:00