summaryrefslogtreecommitdiff
path: root/src/beval.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-07-07 20:30:48 +0200
committerBram Moolenaar <Bram@vim.org>2019-07-07 20:30:48 +0200
commit3f3e954d9676e374f222a18786c78e50af5041cb (patch)
treec564fafbafb3cbf95215d7821c7fdb93b38a43b0 /src/beval.c
parentd84b2c3d88b08722dd4f686256a22c26788ea122 (diff)
downloadvim-git-3f3e954d9676e374f222a18786c78e50af5041cb.tar.gz
patch 8.1.1648: MS-Windows: build error with normal feauresv8.1.1648
Problem: MS-Windows: build error with normal feaures. Solution: Adjust #ifdef for find_word_under_cursor().
Diffstat (limited to 'src/beval.c')
-rw-r--r--src/beval.c114
1 files changed, 58 insertions, 56 deletions
diff --git a/src/beval.c b/src/beval.c
index 2cbe7ea1f..010e20105 100644
--- a/src/beval.c
+++ b/src/beval.c
@@ -10,62 +10,7 @@
#include "vim.h"
-#if defined(FEAT_BEVAL) || defined(PROTO)
-
-/*
- * Get the text and position to be evaluated for "beval".
- * If "getword" is TRUE the returned text is not the whole line but the
- * relevant word in allocated memory.
- * Returns OK or FAIL.
- */
- int
-get_beval_info(
- BalloonEval *beval,
- int getword,
- win_T **winp,
- linenr_T *lnump,
- char_u **textp,
- int *colp)
-{
- int row, col;
-
-# ifdef FEAT_BEVAL_TERM
-# ifdef FEAT_GUI
- if (!gui.in_use)
-# endif
- {
- row = mouse_row;
- col = mouse_col;
- }
-# endif
-# ifdef FEAT_GUI
- if (gui.in_use)
- {
- row = Y_2_ROW(beval->y);
- col = X_2_COL(beval->x);
- }
-#endif
- if (find_word_under_cursor(row, col, getword,
- FIND_IDENT + FIND_STRING + FIND_EVAL,
- winp, lnump, textp, colp) == OK)
- {
-#ifdef FEAT_VARTABS
- vim_free(beval->vts);
- beval->vts = tabstop_copy((*winp)->w_buffer->b_p_vts_array);
- if ((*winp)->w_buffer->b_p_vts_array != NULL && beval->vts == NULL)
- {
- if (getword)
- vim_free(*textp);
- return FAIL;
- }
-#endif
- beval->ts = (*winp)->w_buffer->b_p_ts;
- return OK;
- }
-
- return FAIL;
-}
-
+#if defined(FEAT_BEVAL) || defined(FEAT_TEXT_PROP) || defined(PROT)
/*
* Find text under the mouse position "row" / "col".
* If "getword" is TRUE the returned text in "*textp" is not the whole line but
@@ -174,6 +119,63 @@ find_word_under_cursor(
}
return FAIL;
}
+#endif
+
+#if defined(FEAT_BEVAL) || defined(PROTO)
+
+/*
+ * Get the text and position to be evaluated for "beval".
+ * If "getword" is TRUE the returned text is not the whole line but the
+ * relevant word in allocated memory.
+ * Returns OK or FAIL.
+ */
+ int
+get_beval_info(
+ BalloonEval *beval,
+ int getword,
+ win_T **winp,
+ linenr_T *lnump,
+ char_u **textp,
+ int *colp)
+{
+ int row, col;
+
+# ifdef FEAT_BEVAL_TERM
+# ifdef FEAT_GUI
+ if (!gui.in_use)
+# endif
+ {
+ row = mouse_row;
+ col = mouse_col;
+ }
+# endif
+# ifdef FEAT_GUI
+ if (gui.in_use)
+ {
+ row = Y_2_ROW(beval->y);
+ col = X_2_COL(beval->x);
+ }
+#endif
+ if (find_word_under_cursor(row, col, getword,
+ FIND_IDENT + FIND_STRING + FIND_EVAL,
+ winp, lnump, textp, colp) == OK)
+ {
+#ifdef FEAT_VARTABS
+ vim_free(beval->vts);
+ beval->vts = tabstop_copy((*winp)->w_buffer->b_p_vts_array);
+ if ((*winp)->w_buffer->b_p_vts_array != NULL && beval->vts == NULL)
+ {
+ if (getword)
+ vim_free(*textp);
+ return FAIL;
+ }
+#endif
+ beval->ts = (*winp)->w_buffer->b_p_ts;
+ return OK;
+ }
+
+ return FAIL;
+}
/*
* Show a balloon with "mesg" or "list".