summaryrefslogtreecommitdiff
path: root/src/search.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-06-05 16:01:59 +0200
committerBram Moolenaar <Bram@vim.org>2017-06-05 16:01:59 +0200
commit8ad80dea089ffeb1a845199c013e9bb4be1cd22e (patch)
tree8acbc6f87058076a9965d14ac10e8d37e57f0aa0 /src/search.c
parentb463e8d999ec812d656876f313efbeaeed663b45 (diff)
downloadvim-git-8ad80dea089ffeb1a845199c013e9bb4be1cd22e.tar.gz
patch 8.0.0621: :stag does not respect 'switchbuf'v8.0.0621
Problem: The ":stag" command does not respect 'switchbuf'. Solution: Check 'switchbuf' for tag commands that may open a new window. (Ingo Karkat, closes #1681) Define macros for the return values of getfile().
Diffstat (limited to 'src/search.c')
-rw-r--r--src/search.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/search.c b/src/search.c
index 3145e9a09..bd5d08c34 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1524,9 +1524,9 @@ end_do_search:
* search_for_exact_line(buf, pos, dir, pat)
*
* Search for a line starting with the given pattern (ignoring leading
- * white-space), starting from pos and going in direction dir. pos will
+ * white-space), starting from pos and going in direction "dir". "pos" will
* contain the position of the match found. Blank lines match only if
- * ADDING is set. if p_ic is set then the pattern must be in lowercase.
+ * ADDING is set. If p_ic is set then the pattern must be in lowercase.
* Return OK for success, or FAIL if no line found.
*/
int
@@ -5397,8 +5397,9 @@ search_line:
#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
if (g_do_tagpreview != 0)
{
- if (getfile(0, curwin_save->w_buffer->b_fname,
- NULL, TRUE, lnum, FALSE) > 0)
+ if (!GETFILE_SUCCESS(getfile(
+ 0, curwin_save->w_buffer->b_fname,
+ NULL, TRUE, lnum, FALSE)))
break; /* failed to jump to file */
}
else
@@ -5408,8 +5409,9 @@ search_line:
}
else
{
- if (getfile(0, files[depth].name, NULL, TRUE,
- files[depth].lnum, FALSE) > 0)
+ if (!GETFILE_SUCCESS(getfile(
+ 0, files[depth].name, NULL, TRUE,
+ files[depth].lnum, FALSE)))
break; /* failed to jump to file */
/* autocommands may have changed the lnum, we don't
* want that here */