Skip to content

Commit 3f3e954

Browse files
committed
patch 8.1.1648: MS-Windows: build error with normal feaures
Problem: MS-Windows: build error with normal feaures. Solution: Adjust #ifdef for find_word_under_cursor().
1 parent d84b2c3 commit 3f3e954

3 files changed

Lines changed: 61 additions & 57 deletions

File tree

src/beval.c

Lines changed: 58 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -10,62 +10,7 @@
1010

1111
#include "vim.h"
1212

13-
#if defined(FEAT_BEVAL) || defined(PROTO)
14-
15-
/*
16-
* Get the text and position to be evaluated for "beval".
17-
* If "getword" is TRUE the returned text is not the whole line but the
18-
* relevant word in allocated memory.
19-
* Returns OK or FAIL.
20-
*/
21-
int
22-
get_beval_info(
23-
BalloonEval *beval,
24-
int getword,
25-
win_T **winp,
26-
linenr_T *lnump,
27-
char_u **textp,
28-
int *colp)
29-
{
30-
int row, col;
31-
32-
# ifdef FEAT_BEVAL_TERM
33-
# ifdef FEAT_GUI
34-
if (!gui.in_use)
35-
# endif
36-
{
37-
row = mouse_row;
38-
col = mouse_col;
39-
}
40-
# endif
41-
# ifdef FEAT_GUI
42-
if (gui.in_use)
43-
{
44-
row = Y_2_ROW(beval->y);
45-
col = X_2_COL(beval->x);
46-
}
47-
#endif
48-
if (find_word_under_cursor(row, col, getword,
49-
FIND_IDENT + FIND_STRING + FIND_EVAL,
50-
winp, lnump, textp, colp) == OK)
51-
{
52-
#ifdef FEAT_VARTABS
53-
vim_free(beval->vts);
54-
beval->vts = tabstop_copy((*winp)->w_buffer->b_p_vts_array);
55-
if ((*winp)->w_buffer->b_p_vts_array != NULL && beval->vts == NULL)
56-
{
57-
if (getword)
58-
vim_free(*textp);
59-
return FAIL;
60-
}
61-
#endif
62-
beval->ts = (*winp)->w_buffer->b_p_ts;
63-
return OK;
64-
}
65-
66-
return FAIL;
67-
}
68-
13+
#if defined(FEAT_BEVAL) || defined(FEAT_TEXT_PROP) || defined(PROT)
6914
/*
7015
* Find text under the mouse position "row" / "col".
7116
* If "getword" is TRUE the returned text in "*textp" is not the whole line but
@@ -174,6 +119,63 @@ find_word_under_cursor(
174119
}
175120
return FAIL;
176121
}
122+
#endif
123+
124+
#if defined(FEAT_BEVAL) || defined(PROTO)
125+
126+
/*
127+
* Get the text and position to be evaluated for "beval".
128+
* If "getword" is TRUE the returned text is not the whole line but the
129+
* relevant word in allocated memory.
130+
* Returns OK or FAIL.
131+
*/
132+
int
133+
get_beval_info(
134+
BalloonEval *beval,
135+
int getword,
136+
win_T **winp,
137+
linenr_T *lnump,
138+
char_u **textp,
139+
int *colp)
140+
{
141+
int row, col;
142+
143+
# ifdef FEAT_BEVAL_TERM
144+
# ifdef FEAT_GUI
145+
if (!gui.in_use)
146+
# endif
147+
{
148+
row = mouse_row;
149+
col = mouse_col;
150+
}
151+
# endif
152+
# ifdef FEAT_GUI
153+
if (gui.in_use)
154+
{
155+
row = Y_2_ROW(beval->y);
156+
col = X_2_COL(beval->x);
157+
}
158+
#endif
159+
if (find_word_under_cursor(row, col, getword,
160+
FIND_IDENT + FIND_STRING + FIND_EVAL,
161+
winp, lnump, textp, colp) == OK)
162+
{
163+
#ifdef FEAT_VARTABS
164+
vim_free(beval->vts);
165+
beval->vts = tabstop_copy((*winp)->w_buffer->b_p_vts_array);
166+
if ((*winp)->w_buffer->b_p_vts_array != NULL && beval->vts == NULL)
167+
{
168+
if (getword)
169+
vim_free(*textp);
170+
return FAIL;
171+
}
172+
#endif
173+
beval->ts = (*winp)->w_buffer->b_p_ts;
174+
return OK;
175+
}
176+
177+
return FAIL;
178+
}
177179

178180
/*
179181
* Show a balloon with "mesg" or "list".

src/proto/beval.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* beval.c */
2-
int get_beval_info(BalloonEval *beval, int getword, win_T **winp, linenr_T *lnump, char_u **textp, int *colp);
32
int find_word_under_cursor(int mouserow, int mousecol, int getword, int flags, win_T **winp, linenr_T *lnump, char_u **textp, int *colp);
3+
int get_beval_info(BalloonEval *beval, int getword, win_T **winp, linenr_T *lnump, char_u **textp, int *colp);
44
void post_balloon(BalloonEval *beval, char_u *mesg, list_T *list);
55
int can_use_beval(void);
66
void general_beval_cb(BalloonEval *beval, int state);

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,8 @@ static char *(features[]) =
777777

778778
static int included_patches[] =
779779
{ /* Add new patch number below this line */
780+
/**/
781+
1648,
780782
/**/
781783
1647,
782784
/**/

0 commit comments

Comments
 (0)