]> git.neil.brown.name Git - edlib.git/commitdiff
render-lines: Fix problem rendering '</>'
authorNeilBrown <neil@brown.name>
Tue, 6 Apr 2021 11:22:03 +0000 (21:22 +1000)
committerNeilBrown <neil@brown.name>
Wed, 7 Apr 2021 21:10:20 +0000 (07:10 +1000)
The string looks like the end of markup and confuses one piece of code.

Signed-off-by: NeilBrown <neil@brown.name>
DOC/TODO.md
render-lines.c

index 91ba8a34209eb1c1bd603fc74a99e265c7a7b164..19c7d3b2c71c11430e0f96fe9bf6e04d0882df75 100644 (file)
@@ -19,7 +19,7 @@ Current priorities
 Bugs to be fixed
 ----------------
 
-- [ ] Text containg </> is a problem.  If cursor is just after, it is drawn
+- [X] Text containg </> is a problem.  If cursor is just after, it is drawn
       at start-of-line... oh, I think I know why.
 - [ ] search matches aren't highlighted where there is other highlighting
       like line-too-long or diff colouring
index 166f208ce86f353f05b3a314c127dd1a987d1c7e..27d16f6bb37c45d36585551f0ef7cd73a1a5cc4b 100644 (file)
@@ -327,7 +327,8 @@ DEF_CMD(get_len)
 {
        if (ci->str) {
                int l = strlen(ci->str);
-               while (l >=3 && strncmp(ci->str+l-3, "</>", 3) == 0)
+               while (l >=4 && strncmp(ci->str+l-3, "</>", 3) == 0 &&
+               ci->str[l-4] != '<')
                        l -= 3;
                return l + 1;
        } else