From 6d5cb16ef34c6e07c8ca4697c0f6e58e5b574b7e Mon Sep 17 00:00:00 2001 From: Nathan Vegdahl Date: Mon, 17 Feb 2020 07:42:23 +0900 Subject: [PATCH] Another bug fix after the refactor. --- src/formatter.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/formatter.rs b/src/formatter.rs index 9204494..69552ad 100644 --- a/src/formatter.rs +++ b/src/formatter.rs @@ -122,7 +122,7 @@ impl LineFormatter { // Check if we've found the horizontal position _and_ the passed // char_idx on the same line, and return if so. - if i >= char_offset && hpos_char_idx != None { + if (i + char_count(&g)) > char_offset && hpos_char_idx != None { return char_idx - char_offset + hpos_char_idx.unwrap(); }