Mercurial > vim
comparison src/move.c @ 17863:08f1dd29550e v8.1.1928
patch 8.1.1928: popup windows don't move with the text when making changes
Commit: https://github.com/vim/vim/commit/12034e22dd80cf533ac1c681be521ab299383f63
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Aug 25 22:25:02 2019 +0200
patch 8.1.1928: popup windows don't move with the text when making changes
Problem: Popup windows don't move with the text when making changes.
Solution: Add the 'textprop" property to the popup window options, position
the popup relative to a text property. (closes #4560)
No tests yet.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 25 Aug 2019 22:30:03 +0200 |
parents | 59f8948b7590 |
children | 9f51d0cef8da |
comparison
equal
deleted
inserted
replaced
17862:debebb1dcef1 | 17863:08f1dd29550e |
---|---|
1177 #endif | 1177 #endif |
1178 | 1178 |
1179 curwin->w_valid |= VALID_WCOL|VALID_WROW|VALID_VIRTCOL; | 1179 curwin->w_valid |= VALID_WCOL|VALID_WROW|VALID_VIRTCOL; |
1180 } | 1180 } |
1181 | 1181 |
1182 #if defined(FEAT_EVAL) || defined(PROTO) | 1182 #if (defined(FEAT_EVAL) || defined(FEAT_TEXT_PROP)) || defined(PROTO) |
1183 /* | 1183 /* |
1184 * Compute the screen position of text character at "pos" in window "wp" | 1184 * Compute the screen position of text character at "pos" in window "wp" |
1185 * The resulting values are one-based, zero when character is not visible. | 1185 * The resulting values are one-based, zero when character is not visible. |
1186 */ | 1186 */ |
1187 static void | 1187 void |
1188 textpos2screenpos( | 1188 textpos2screenpos( |
1189 win_T *wp, | 1189 win_T *wp, |
1190 pos_T *pos, | 1190 pos_T *pos, |
1191 int *rowp, // screen row | 1191 int *rowp, // screen row |
1192 int *scolp, // start screen column | 1192 int *scolp, // start screen column |
1211 col = scol; | 1211 col = scol; |
1212 off = win_col_off(wp); | 1212 off = win_col_off(wp); |
1213 col += off; | 1213 col += off; |
1214 width = wp->w_width - off + win_col_off2(wp); | 1214 width = wp->w_width - off + win_col_off2(wp); |
1215 | 1215 |
1216 /* long line wrapping, adjust row */ | 1216 // long line wrapping, adjust row |
1217 if (wp->w_p_wrap | 1217 if (wp->w_p_wrap |
1218 && col >= (colnr_T)wp->w_width | 1218 && col >= (colnr_T)wp->w_width |
1219 && width > 0) | 1219 && width > 0) |
1220 { | 1220 { |
1221 /* use same formula as what is used in curs_columns() */ | 1221 // use same formula as what is used in curs_columns() |
1222 rowoff = ((col - wp->w_width) / width + 1); | 1222 rowoff = ((col - wp->w_width) / width + 1); |
1223 col -= rowoff * width; | 1223 col -= rowoff * width; |
1224 } | 1224 } |
1225 col -= wp->w_leftcol; | 1225 col -= wp->w_leftcol; |
1226 if (col >= width) | 1226 if (col >= width) |
1234 *rowp = wp->w_winrow + row + rowoff; | 1234 *rowp = wp->w_winrow + row + rowoff; |
1235 *scolp = scol + coloff; | 1235 *scolp = scol + coloff; |
1236 *ccolp = ccol + coloff; | 1236 *ccolp = ccol + coloff; |
1237 *ecolp = ecol + coloff; | 1237 *ecolp = ecol + coloff; |
1238 } | 1238 } |
1239 | 1239 #endif |
1240 | |
1241 #if defined(FEAT_EVAL) || defined(PROTO) | |
1240 /* | 1242 /* |
1241 * "screenpos({winid}, {lnum}, {col})" function | 1243 * "screenpos({winid}, {lnum}, {col})" function |
1242 */ | 1244 */ |
1243 void | 1245 void |
1244 f_screenpos(typval_T *argvars UNUSED, typval_T *rettv) | 1246 f_screenpos(typval_T *argvars UNUSED, typval_T *rettv) |