summaryrefslogtreecommitdiffstats
path: root/src/align.rs
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2020-06-26 12:56:36 -0400
committerDan Davison <dandavison7@gmail.com>2020-06-26 13:50:49 -0400
commit8c1ed7b2dad3b83196ab9272174d6452b6fc75f2 (patch)
treeece9210fba34b8423ea00001c2d202d5ea8bec2a /src/align.rs
parenta5705f305d3d26e0d522e9bd8580f7c395ba5ebd (diff)
Bugfix: fix highlighting bug (no test coverage)
Diffstat (limited to 'src/align.rs')
-rw-r--r--src/align.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/align.rs b/src/align.rs
index 6ce4863c..4cd102c6 100644
--- a/src/align.rs
+++ b/src/align.rs
@@ -34,6 +34,9 @@ pub struct Alignment<'a> {
impl<'a> Alignment<'a> {
/// Fill table for Levenshtein distance / alignment computation
pub fn new(x: Vec<&'a str>, y: Vec<&'a str>) -> Self {
+ // TODO: Something about the alignment algorithm requires that the first two items in the
+ // token stream are ["", " "]. In practice this means that the line must have a leading
+ // space, and that the tokenization regex cooperates.
let dim = [y.len() + 1, x.len() + 1];
let table = vec![
Cell {