diff options
Diffstat (limited to 'Src/Zle/zle_utils.c')
-rw-r--r-- | Src/Zle/zle_utils.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Src/Zle/zle_utils.c b/Src/Zle/zle_utils.c index 9cfa8813d..1089e274f 100644 --- a/Src/Zle/zle_utils.c +++ b/Src/Zle/zle_utils.c @@ -710,6 +710,27 @@ zle_restore_positions(void) } /* + * Discard positions previously saved, the line has been updated. + */ + +/**/ +mod_export void +zle_free_positions(void) +{ + struct zle_position *oldpos = zle_positions; + struct zle_region *oldrhp; + + zle_positions = oldpos->next; + oldrhp = oldpos->regions; + while (oldrhp) { + struct zle_region *nextrhp = oldrhp->next; + zfree(oldrhp, sizeof(*oldrhp)); + oldrhp = nextrhp; + } + zfree(oldpos, sizeof(*oldpos)); +} + +/* * Basic utility functions for adding to line or removing from line. * At this level the counts supplied are raw character counts, so * the calling code must be aware of combining characters where |