Mercurial > vim
comparison src/term.c @ 9487:69ed2c9d34a6 v7.4.2024
commit https://github.com/vim/vim/commit/7c0a2f367f2507669560b1a66423155c70d2e75b
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jul 10 22:11:16 2016 +0200
patch 7.4.2024
Problem: More buf_valid() calls can be optimized.
Solution: Use bufref_valid() instead.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 10 Jul 2016 22:15:06 +0200 |
parents | bcc132f80109 |
children | b2aada04d84e |
comparison
equal
deleted
inserted
replaced
9486:b931ed8a6782 | 9487:69ed2c9d34a6 |
---|---|
1906 scroll_region_reset(); /* In case Rows changed */ | 1906 scroll_region_reset(); /* In case Rows changed */ |
1907 check_map_keycodes(); /* check mappings for terminal codes used */ | 1907 check_map_keycodes(); /* check mappings for terminal codes used */ |
1908 | 1908 |
1909 #ifdef FEAT_AUTOCMD | 1909 #ifdef FEAT_AUTOCMD |
1910 { | 1910 { |
1911 buf_T *old_curbuf; | 1911 bufref_T old_curbuf; |
1912 | 1912 |
1913 /* | 1913 /* |
1914 * Execute the TermChanged autocommands for each buffer that is | 1914 * Execute the TermChanged autocommands for each buffer that is |
1915 * loaded. | 1915 * loaded. |
1916 */ | 1916 */ |
1917 old_curbuf = curbuf; | 1917 set_bufref(&old_curbuf, curbuf); |
1918 for (curbuf = firstbuf; curbuf != NULL; curbuf = curbuf->b_next) | 1918 for (curbuf = firstbuf; curbuf != NULL; curbuf = curbuf->b_next) |
1919 { | 1919 { |
1920 if (curbuf->b_ml.ml_mfp != NULL) | 1920 if (curbuf->b_ml.ml_mfp != NULL) |
1921 apply_autocmds(EVENT_TERMCHANGED, NULL, NULL, FALSE, | 1921 apply_autocmds(EVENT_TERMCHANGED, NULL, NULL, FALSE, |
1922 curbuf); | 1922 curbuf); |
1923 } | 1923 } |
1924 if (buf_valid(old_curbuf)) | 1924 if (bufref_valid(&old_curbuf)) |
1925 curbuf = old_curbuf; | 1925 curbuf = old_curbuf.br_buf; |
1926 } | 1926 } |
1927 #endif | 1927 #endif |
1928 } | 1928 } |
1929 | 1929 |
1930 #ifdef FEAT_TERMRESPONSE | 1930 #ifdef FEAT_TERMRESPONSE |