Mercurial > vim
comparison src/buffer.c @ 34365:8303936dbd64 v9.1.0113
patch 9.1.0113: duplicate code when cleaning undo stack
Commit: https://github.com/vim/vim/commit/9071ed8107244e0c56a16b77d1c28e975cb21dd2
Author: Christian Brabandt <cb@256bit.org>
Date: Thu Feb 15 20:17:37 2024 +0100
patch 9.1.0113: duplicate code when cleaning undo stack
Problem: duplicate code when cleaning undo stack
Solution: refactor undo cleanup into a single public function
related: #13928
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 15 Feb 2024 20:30:05 +0100 |
parents | 08e6a44e5c77 |
children | 0a458b49e1e6 |
comparison
equal
deleted
inserted
replaced
34364:f5d16cbbf2d5 | 34365:8303936dbd64 |
---|---|
917 tcl_buffer_free(buf); | 917 tcl_buffer_free(buf); |
918 #endif | 918 #endif |
919 ml_close(buf, TRUE); // close and delete the memline/memfile | 919 ml_close(buf, TRUE); // close and delete the memline/memfile |
920 buf->b_ml.ml_line_count = 0; // no lines in buffer | 920 buf->b_ml.ml_line_count = 0; // no lines in buffer |
921 if ((flags & BFA_KEEP_UNDO) == 0) | 921 if ((flags & BFA_KEEP_UNDO) == 0) |
922 { | 922 // free the memory allocated for undo |
923 u_blockfree(buf); // free the memory allocated for undo | 923 // and reset all undo information |
924 u_clearall(buf); // reset all undo information | 924 u_clearallandblockfree(buf); |
925 } | |
926 #ifdef FEAT_SYN_HL | 925 #ifdef FEAT_SYN_HL |
927 syntax_clear(&buf->b_s); // reset syntax info | 926 syntax_clear(&buf->b_s); // reset syntax info |
928 #endif | 927 #endif |
929 #ifdef FEAT_PROP_POPUP | 928 #ifdef FEAT_PROP_POPUP |
930 clear_buf_prop_types(buf); | 929 clear_buf_prop_types(buf); |