@@ -45,10 +45,6 @@ static int append_arg_number(win_T *wp, char_u *buf, int buflen, int add_file);
4545static void free_buffer (buf_T * );
4646static void free_buffer_stuff (buf_T * buf , int free_options );
4747static void clear_wininfo (buf_T * buf );
48- #if defined(FEAT_JOB_CHANNEL ) \
49- || defined(FEAT_PYTHON ) || defined(FEAT_PYTHON3 )
50- static int find_win_for_buf (buf_T * buf , win_T * * wp , tabpage_T * * tp );
51- #endif
5248
5349#ifdef UNIX
5450# define dev_T dev_t
@@ -5457,7 +5453,24 @@ buf_spname(buf_T *buf)
54575453#if defined(FEAT_JOB_CHANNEL ) \
54585454 || defined(FEAT_PYTHON ) || defined(FEAT_PYTHON3 ) \
54595455 || defined(PROTO )
5460- # define SWITCH_TO_WIN
5456+ /*
5457+ * Find a window for buffer "buf".
5458+ * If found OK is returned and "wp" and "tp" are set to the window and tabpage.
5459+ * If not found FAIL is returned.
5460+ */
5461+ static int
5462+ find_win_for_buf (
5463+ buf_T * buf ,
5464+ win_T * * wp ,
5465+ tabpage_T * * tp )
5466+ {
5467+ FOR_ALL_TAB_WINDOWS (* tp , * wp )
5468+ if ((* wp )-> w_buffer == buf )
5469+ goto win_found ;
5470+ return FAIL ;
5471+ win_found :
5472+ return OK ;
5473+ }
54615474
54625475/*
54635476 * Find a window that contains "buf" and switch to it.
@@ -5497,27 +5510,6 @@ restore_win_for_buf(
54975510}
54985511#endif
54995512
5500- #if defined(FEAT_QUICKFIX ) || defined(SWITCH_TO_WIN ) || defined(PROTO )
5501- /*
5502- * Find a window for buffer "buf".
5503- * If found OK is returned and "wp" and "tp" are set to the window and tabpage.
5504- * If not found FAIL is returned.
5505- */
5506- static int
5507- find_win_for_buf (
5508- buf_T * buf ,
5509- win_T * * wp ,
5510- tabpage_T * * tp )
5511- {
5512- FOR_ALL_TAB_WINDOWS (* tp , * wp )
5513- if ((* wp )-> w_buffer == buf )
5514- goto win_found ;
5515- return FAIL ;
5516- win_found :
5517- return OK ;
5518- }
5519- #endif
5520-
55215513/*
55225514 * Set 'buflisted' for curbuf to "on" and trigger autocommands if it changed.
55235515 */
0 commit comments