comparison src/search.c @ 34470:dd8f5311cee5 v9.1.0147

patch 9.1.0147: Cannot keep a buffer focused in a window Commit: https://github.com/vim/vim/commit/215703563757a4464907ead6fb9edaeb7f430bea Author: Colin Kennedy <colinvfx@gmail.com> Date: Sun Mar 3 16:16:47 2024 +0100 patch 9.1.0147: Cannot keep a buffer focused in a window Problem: Cannot keep a buffer focused in a window (Amit Levy) Solution: Add the 'winfixbuf' window-local option (Colin Kennedy) fixes: #6445 closes: #13903 Signed-off-by: Colin Kennedy <colinvfx@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sun, 03 Mar 2024 16:30:06 +0100
parents 59d706a161a4
children 9e093c96dff6
comparison
equal deleted inserted replaced
34469:055c08ca0446 34470:dd8f5311cee5
3290 int type, // Type of search; are we looking for a type? 3290 int type, // Type of search; are we looking for a type?
3291 // a macro? 3291 // a macro?
3292 long count, 3292 long count,
3293 int action, // What to do when we find it 3293 int action, // What to do when we find it
3294 linenr_T start_lnum, // first line to start searching 3294 linenr_T start_lnum, // first line to start searching
3295 linenr_T end_lnum) // last line for searching 3295 linenr_T end_lnum, // last line for searching
3296 int forceit) // If true, always switch to the found path
3296 { 3297 {
3297 SearchedFile *files; // Stack of included files 3298 SearchedFile *files; // Stack of included files
3298 SearchedFile *bigger; // When we need more space 3299 SearchedFile *bigger; // When we need more space
3299 int max_path_depth = 50; 3300 int max_path_depth = 50;
3300 long match_count = 1; 3301 long match_count = 1;
3827 { 3828 {
3828 if (!win_valid(curwin_save)) 3829 if (!win_valid(curwin_save))
3829 break; 3830 break;
3830 if (!GETFILE_SUCCESS(getfile( 3831 if (!GETFILE_SUCCESS(getfile(
3831 curwin_save->w_buffer->b_fnum, NULL, 3832 curwin_save->w_buffer->b_fnum, NULL,
3832 NULL, TRUE, lnum, FALSE))) 3833 NULL, TRUE, lnum, forceit)))
3833 break; // failed to jump to file 3834 break; // failed to jump to file
3834 } 3835 }
3835 else 3836 else
3836 #endif 3837 #endif
3837 setpcmark(); 3838 setpcmark();
3840 } 3841 }
3841 else 3842 else
3842 { 3843 {
3843 if (!GETFILE_SUCCESS(getfile( 3844 if (!GETFILE_SUCCESS(getfile(
3844 0, files[depth].name, NULL, TRUE, 3845 0, files[depth].name, NULL, TRUE,
3845 files[depth].lnum, FALSE))) 3846 files[depth].lnum, forceit)))
3846 break; // failed to jump to file 3847 break; // failed to jump to file
3847 // autocommands may have changed the lnum, we don't 3848 // autocommands may have changed the lnum, we don't
3848 // want that here 3849 // want that here
3849 curwin->w_cursor.lnum = files[depth].lnum; 3850 curwin->w_cursor.lnum = files[depth].lnum;
3850 } 3851 }