Mercurial > vim
comparison src/search.c @ 12477:68d7bc045dbe v8.0.1118
patch 8.0.1118: FEAT_WINDOWS adds a lot of #ifdefs
commit https://github.com/vim/vim/commit/4033c55eca575777718c0701e26635a0cc47d907
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Sep 16 20:54:51 2017 +0200
patch 8.0.1118: FEAT_WINDOWS adds a lot of #ifdefs
Problem: FEAT_WINDOWS adds a lot of #ifdefs while it is nearly always
enabled and only adds 7% to the binary size of the tiny build.
Solution: Graduate FEAT_WINDOWS.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 16 Sep 2017 21:00:06 +0200 |
parents | 5e36b2f825cb |
children | 972ea22c946f |
comparison
equal
deleted
inserted
replaced
12476:2516383741e6 | 12477:68d7bc045dbe |
---|---|
4904 int found = FALSE; | 4904 int found = FALSE; |
4905 int i; | 4905 int i; |
4906 char_u *already = NULL; | 4906 char_u *already = NULL; |
4907 char_u *startp = NULL; | 4907 char_u *startp = NULL; |
4908 char_u *inc_opt = NULL; | 4908 char_u *inc_opt = NULL; |
4909 #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX) | 4909 #if defined(FEAT_QUICKFIX) |
4910 win_T *curwin_save = NULL; | 4910 win_T *curwin_save = NULL; |
4911 #endif | 4911 #endif |
4912 | 4912 |
4913 regmatch.regprog = NULL; | 4913 regmatch.regprog = NULL; |
4914 incl_regmatch.regprog = NULL; | 4914 incl_regmatch.regprog = NULL; |
5383 } | 5383 } |
5384 else if (--count <= 0) | 5384 else if (--count <= 0) |
5385 { | 5385 { |
5386 found = TRUE; | 5386 found = TRUE; |
5387 if (depth == -1 && lnum == curwin->w_cursor.lnum | 5387 if (depth == -1 && lnum == curwin->w_cursor.lnum |
5388 #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX) | 5388 #if defined(FEAT_QUICKFIX) |
5389 && g_do_tagpreview == 0 | 5389 && g_do_tagpreview == 0 |
5390 #endif | 5390 #endif |
5391 ) | 5391 ) |
5392 EMSG(_("E387: Match is on current line")); | 5392 EMSG(_("E387: Match is on current line")); |
5393 else if (action == ACTION_SHOW) | 5393 else if (action == ACTION_SHOW) |
5400 else | 5400 else |
5401 { | 5401 { |
5402 #ifdef FEAT_GUI | 5402 #ifdef FEAT_GUI |
5403 need_mouse_correct = TRUE; | 5403 need_mouse_correct = TRUE; |
5404 #endif | 5404 #endif |
5405 #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX) | 5405 #if defined(FEAT_QUICKFIX) |
5406 /* ":psearch" uses the preview window */ | 5406 /* ":psearch" uses the preview window */ |
5407 if (g_do_tagpreview != 0) | 5407 if (g_do_tagpreview != 0) |
5408 { | 5408 { |
5409 curwin_save = curwin; | 5409 curwin_save = curwin; |
5410 prepare_tagpreview(TRUE); | 5410 prepare_tagpreview(TRUE); |
5411 } | 5411 } |
5412 #endif | 5412 #endif |
5413 if (action == ACTION_SPLIT) | 5413 if (action == ACTION_SPLIT) |
5414 { | 5414 { |
5415 #ifdef FEAT_WINDOWS | |
5416 if (win_split(0, 0) == FAIL) | 5415 if (win_split(0, 0) == FAIL) |
5417 #endif | |
5418 break; | 5416 break; |
5419 RESET_BINDING(curwin); | 5417 RESET_BINDING(curwin); |
5420 } | 5418 } |
5421 if (depth == -1) | 5419 if (depth == -1) |
5422 { | 5420 { |
5423 /* match in current file */ | 5421 /* match in current file */ |
5424 #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX) | 5422 #if defined(FEAT_QUICKFIX) |
5425 if (g_do_tagpreview != 0) | 5423 if (g_do_tagpreview != 0) |
5426 { | 5424 { |
5427 if (!GETFILE_SUCCESS(getfile( | 5425 if (!GETFILE_SUCCESS(getfile( |
5428 curwin_save->w_buffer->b_fnum, NULL, | 5426 curwin_save->w_buffer->b_fnum, NULL, |
5429 NULL, TRUE, lnum, FALSE))) | 5427 NULL, TRUE, lnum, FALSE))) |
5450 { | 5448 { |
5451 curwin->w_cursor.col = (colnr_T)(startp - line); | 5449 curwin->w_cursor.col = (colnr_T)(startp - line); |
5452 curwin->w_set_curswant = TRUE; | 5450 curwin->w_set_curswant = TRUE; |
5453 } | 5451 } |
5454 | 5452 |
5455 #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX) | 5453 #if defined(FEAT_QUICKFIX) |
5456 if (g_do_tagpreview != 0 | 5454 if (g_do_tagpreview != 0 |
5457 && curwin != curwin_save && win_valid(curwin_save)) | 5455 && curwin != curwin_save && win_valid(curwin_save)) |
5458 { | 5456 { |
5459 /* Return cursor to where we were */ | 5457 /* Return cursor to where we were */ |
5460 validate_cursor(); | 5458 validate_cursor(); |