diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/indent.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/indent.c b/src/indent.c index 3ada091d45f..9cdfb3cf046 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -1235,11 +1235,18 @@ pos_tab_offset (w, pos) | |||
| 1235 | int col; | 1235 | int col; |
| 1236 | int width = window_internal_width (w) - 1; | 1236 | int width = window_internal_width (w) - 1; |
| 1237 | 1237 | ||
| 1238 | if (pos == BEGV || FETCH_CHAR (pos - 1) == '\n') | 1238 | if (pos == BEGV) |
| 1239 | return MINI_WINDOW_P (w) ? -minibuf_prompt_width : 0; | ||
| 1240 | if (FETCH_CHAR (pos - 1) == '\n') | ||
| 1239 | return 0; | 1241 | return 0; |
| 1240 | TEMP_SET_PT (pos); | 1242 | TEMP_SET_PT (pos); |
| 1241 | col = current_column (); | 1243 | col = current_column (); |
| 1242 | TEMP_SET_PT (opoint); | 1244 | TEMP_SET_PT (opoint); |
| 1245 | /* In the continuation of the first line in a minibuffer we must | ||
| 1246 | take the width of the prompt into account. */ | ||
| 1247 | if (MINI_WINDOW_P (w) && col >= width - minibuf_prompt_width | ||
| 1248 | && find_next_newline_no_quit (pos, -1) == BEGV) | ||
| 1249 | return col - (col + minibuf_prompt_width) % width; | ||
| 1243 | return col - (col % width); | 1250 | return col - (col % width); |
| 1244 | } | 1251 | } |
| 1245 | 1252 | ||
| @@ -1314,7 +1321,13 @@ vmotion (from, vtarget, w) | |||
| 1314 | ? start_hpos : 0), | 1321 | ? start_hpos : 0), |
| 1315 | 0, | 1322 | 0, |
| 1316 | from, 1 << (BITS_PER_INT - 2), 0, | 1323 | from, 1 << (BITS_PER_INT - 2), 0, |
| 1317 | width, hscroll, 0, w); | 1324 | width, hscroll, |
| 1325 | /* This compensates for start_hpos | ||
| 1326 | so that a tab as first character | ||
| 1327 | still occupies 8 columns. */ | ||
| 1328 | (XFASTINT (prevline) == BEG | ||
| 1329 | ? -start_hpos : 0), | ||
| 1330 | w); | ||
| 1318 | vpos -= pos.vpos; | 1331 | vpos -= pos.vpos; |
| 1319 | first = 0; | 1332 | first = 0; |
| 1320 | from = XFASTINT (prevline); | 1333 | from = XFASTINT (prevline); |
| @@ -1361,7 +1374,9 @@ vmotion (from, vtarget, w) | |||
| 1361 | ? start_hpos : 0), | 1374 | ? start_hpos : 0), |
| 1362 | 0, | 1375 | 0, |
| 1363 | from, 1 << (BITS_PER_INT - 2), 0, | 1376 | from, 1 << (BITS_PER_INT - 2), 0, |
| 1364 | width, hscroll, 0, w); | 1377 | width, hscroll, |
| 1378 | (XFASTINT (prevline) == BEG ? -start_hpos : 0), | ||
| 1379 | w); | ||
| 1365 | did_motion = 1; | 1380 | did_motion = 1; |
| 1366 | } | 1381 | } |
| 1367 | else | 1382 | else |
| @@ -1372,7 +1387,9 @@ vmotion (from, vtarget, w) | |||
| 1372 | } | 1387 | } |
| 1373 | return compute_motion (from, vpos, pos.hpos, did_motion, | 1388 | return compute_motion (from, vpos, pos.hpos, did_motion, |
| 1374 | ZV, vtarget, - (1 << (BITS_PER_INT - 2)), | 1389 | ZV, vtarget, - (1 << (BITS_PER_INT - 2)), |
| 1375 | width, hscroll, pos.vpos * width, w); | 1390 | width, hscroll, |
| 1391 | pos.vpos * width - (from == BEG ? start_hpos : 0), | ||
| 1392 | w); | ||
| 1376 | } | 1393 | } |
| 1377 | 1394 | ||
| 1378 | DEFUN ("vertical-motion", Fvertical_motion, Svertical_motion, 1, 2, 0, | 1395 | DEFUN ("vertical-motion", Fvertical_motion, Svertical_motion, 1, 2, 0, |