]> git.neil.brown.name Git - edlib.git/commitdiff
renderline: fix handling of <hide> with nested attrs.
authorNeilBrown <neil@brown.name>
Fri, 29 Sep 2023 09:29:05 +0000 (19:29 +1000)
committerNeilBrown <neil@brown.name>
Fri, 29 Sep 2023 23:47:12 +0000 (09:47 +1000)
Without this, a 'hide' would stop when any nest attribute stopped.

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

index 121faccff87c05717abad1df6801f9709f9bda6b..f81ef9abc1cba6b2050d685b84a9a4b4a61aaa88 100644 (file)
@@ -16,7 +16,7 @@ the file.
       in x11selection_Xcb gets freed???
 - [X] adding new lines at end of doc in x11 leaves phantom underline
       cursors.
-- [ ] 20230908090027.6AA0DC05B9@prodcs.lwn.net has a wrapped
+- [X] 20230908090027.6AA0DC05B9@prodcs.lwn.net has a wrapped
       <a> tag which isn't parsed well.
 - [X] find-document - if default doc has <>, displays wrongly.
 - [X] From start-of-file move to end, then up, then down.
index 04c9a5cf116c7f22de7324850f420beaeea5a103..e5d8169aaa951529a5b7c839ac2d17df2eeff07e 100644 (file)
@@ -63,7 +63,6 @@
  *                       recognised has "wrap-" stripped and is used for the
  *                       head and tail. Default is fg:blue,underline
  *  hide               - Text is hidden if cursor is not within range.
- *                       NOT YET IMPLEMENTED
  *
  * "nn" is measured in "points" which is 1/10 the nominal width of chars
  * in the default font size, which is called "10".  A positive value is
@@ -96,7 +95,7 @@ struct render_item {
                                 * it.
                                 */
        uint8_t         hide;   /* This and consecutive render_items
-                                * with the same hide nmber form a
+                                * with the same hide number form a
                                 * hidden extent which is visible when
                                 * the cursor is in it.
                                 */
@@ -256,8 +255,8 @@ static void parse_line(struct rline_data *rd safe)
                         * which should leave either a trailing comma, or an
                         * empty string.
                         */
-                       buf_append(&attr, ',');
                        old_len = attr.len;
+                       buf_append(&attr, ',');
                        foreach_attr(a, v, st, line) {
                                if (amatch(a, "centre") || amatch(a, "center") ||
                                    amatch(a, "ctab")) {