- Timestamp:
- Jul 11, 2009, 1:14:33 PM (16 years ago)
- Branches:
- master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 2021bea
- Parents:
- b5ef65c
- git-author:
- Karl Ramm <kcr@1ts.org> (06/09/09 11:29:42)
- git-committer:
- Nelson Elhage <nelhage@mit.edu> (07/11/09 13:14:33)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
editwin.c
rb5ef65c r77d4402 312 312 char *p; 313 313 314 /* are we at the point already? */ 314 while(1) { 315 /* note the position of the dot */ 315 316 if (x != NULL && index == e->index) 316 317 *x = width; 317 while(1) { 318 318 319 /* get the current character */ 319 320 c = g_utf8_get_char(e->buff + index); … … 327 328 cw = 0; 328 329 329 if (width + cw > e->wincols) 330 if (width + cw > e->wincols) { 331 if (x != NULL && *x == width) 332 *x = -1; 330 333 break; 334 } 331 335 width += cw; 332 336 333 337 if (c == '\n') { 334 ++index; /* skip the newline */ 338 if (width < e->wincols) 339 ++index; /* skip the newline */ 335 340 break; 336 341 } … … 345 350 index = p - e->buff; 346 351 347 /* note the position of the dot */348 if (x != NULL && index == e->index)349 *x = width;350 352 } 351 353 return index; … … 394 396 { 395 397 int x = -1, y = -1, t; 396 int line, index, lineindex ;398 int line, index, lineindex, times = 0; 397 399 398 400 do { … … 418 420 if (x == -1) 419 421 e->topindex = -1; /* force a reframe */ 420 } while(x == -1); 422 times++; 423 } while(x == -1 && times < 3); 421 424 422 425 wmove(e->curswin, y, x); … … 819 822 distance += owl_editwin_point_move(e, 1); 820 823 } 824 e->goal_column = 0; /* subtleties */ 821 825 822 826 return distance; … … 974 978 end = e->index; 975 979 oe_restore_excursion(e, &x); 976 _owl_editwin_remove_bytes(e, end - e->index); 980 if (end - e->index) 981 _owl_editwin_remove_bytes(e, end - e->index); 982 else if (end < e->bufflen) 983 _owl_editwin_remove_bytes(e, 1); 977 984 } 978 985
Note: See TracChangeset
for help on using the changeset viewer.