diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-09-07 15:45:32 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-09-07 15:45:32 +0200 |
commit | 261f346f8154c0ec7094a4a211c653c74e9f7c2e (patch) | |
tree | ae8f30b11e3a637d1c69bac234d0edd721d4a542 /src/buffer.c | |
parent | a3a124627d2eb9d36e3dc3757429d87e041f8c0b (diff) |
patch 8.1.2001: some source files are too bigv8.1.2001
Problem: Some source files are too big.
Solution: Move buffer and window related functions to evalbuffer.c and
evalwindow.c. (Yegappan Lakshmanan, closes #4898)
Diffstat (limited to 'src/buffer.c')
-rw-r--r-- | src/buffer.c | 105 |
1 files changed, 0 insertions, 105 deletions
diff --git a/src/buffer.c b/src/buffer.c index c42dece642..81f2799f49 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -5450,66 +5450,6 @@ buf_spname(buf_T *buf) return NULL; } -#if defined(FEAT_JOB_CHANNEL) \ - || defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) \ - || defined(PROTO) -/* - * Find a window for buffer "buf". - * If found OK is returned and "wp" and "tp" are set to the window and tabpage. - * If not found FAIL is returned. - */ - static int -find_win_for_buf( - buf_T *buf, - win_T **wp, - tabpage_T **tp) -{ - FOR_ALL_TAB_WINDOWS(*tp, *wp) - if ((*wp)->w_buffer == buf) - goto win_found; - return FAIL; -win_found: - return OK; -} - -/* - * Find a window that contains "buf" and switch to it. - * If there is no such window, use the current window and change "curbuf". - * Caller must initialize save_curbuf to NULL. - * restore_win_for_buf() MUST be called later! - */ - void -switch_to_win_for_buf( - buf_T *buf, - win_T **save_curwinp, - tabpage_T **save_curtabp, - bufref_T *save_curbuf) -{ - win_T *wp; - tabpage_T *tp; - - if (find_win_for_buf(buf, &wp, &tp) == FAIL) - switch_buffer(save_curbuf, buf); - else if (switch_win(save_curwinp, save_curtabp, wp, tp, TRUE) == FAIL) - { - restore_win(*save_curwinp, *save_curtabp, TRUE); - switch_buffer(save_curbuf, buf); - } -} - - void -restore_win_for_buf( - win_T *save_curwin, - tabpage_T *save_curtab, - bufref_T *save_curbuf) -{ - if (save_curbuf->br_buf == NULL) - restore_win(save_curwin, save_curtab, TRUE); - else - restore_buffer(save_curbuf); -} -#endif - /* * Set 'buflisted' for curbuf to "on" and trigger autocommands if it changed. */ @@ -5603,48 +5543,3 @@ wipe_buffer( if (!aucmd) unblock_autocmds(); } - -#if defined(FEAT_EVAL) || defined(PROTO) -/* - * Mark references in functions of buffers. - */ - int -set_ref_in_buffers(int copyID) -{ - int abort = FALSE; - buf_T *bp; - - FOR_ALL_BUFFERS(bp) - { - listener_T *lnr; - typval_T tv; - - for (lnr = bp->b_listener; !abort && lnr != NULL; lnr = lnr->lr_next) - { - if (lnr->lr_callback.cb_partial != NULL) - { - tv.v_type = VAR_PARTIAL; - tv.vval.v_partial = lnr->lr_callback.cb_partial; - abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL); - } - } -# ifdef FEAT_JOB_CHANNEL - if (!abort && bp->b_prompt_callback.cb_partial != NULL) - { - tv.v_type = VAR_PARTIAL; - tv.vval.v_partial = bp->b_prompt_callback.cb_partial; - abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL); - } - if (!abort && bp->b_prompt_interrupt.cb_partial != NULL) - { - tv.v_type = VAR_PARTIAL; - tv.vval.v_partial = bp->b_prompt_interrupt.cb_partial; - abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL); - } -# endif - if (abort) - break; - } - return abort; -} -#endif |