- Timestamp:
- May 3, 2010, 9:08:14 PM (15 years ago)
- Branches:
- master, release-1.10, release-1.7, release-1.8, release-1.9
- Children:
- d625cfd
- Parents:
- 7ce30a9
- git-author:
- Nelson Elhage <nelhage@mit.edu> (04/28/10 00:14:48)
- git-committer:
- Nelson Elhage <nelhage@mit.edu> (05/03/10 21:08:14)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
editwin.c
r7ce30a9 r7149832 47 47 static int oe_char_width(gunichar c, int column); 48 48 static int oe_region_width(owl_editwin *e, int start, int end, int width); 49 static int oe_find_display_line(owl_editwin *e, int *x, int index );49 static int oe_find_display_line(owl_editwin *e, int *x, int index, int *hard); 50 50 static void oe_insert_char(owl_editwin *e, gunichar c); 51 51 static int owl_editwin_limit_maxcols(int v, int maxv); … … 388 388 } 389 389 390 static int oe_find_display_line(owl_editwin *e, int *x, int index )390 static int oe_find_display_line(owl_editwin *e, int *x, int index, int *hard) 391 391 { 392 392 int width = 0, cw; … … 408 408 if (x != NULL && *x == width) 409 409 *x = -1; 410 if (hard != NULL) *hard = 0; 410 411 break; 411 412 } … … 415 416 if (width < e->wincols) 416 417 ++index; /* skip the newline */ 418 if (hard != NULL) *hard = 1; 417 419 break; 418 420 } … … 423 425 if (x != NULL && e->index > index) 424 426 *x = width + 1; 427 if (hard != NULL) *hard = 1; 425 428 break; 426 429 } … … 452 455 last = e->index; 453 456 for (n = 0, i = e->index; i < index; n++) 454 i = oe_find_display_line(e, NULL, i );457 i = oe_find_display_line(e, NULL, i, NULL); 455 458 count += n == 0 ? 1 : n; 456 459 if (count < goal) … … 461 464 /* if we overshot, backtrack */ 462 465 for (n = 0; n < (count - goal); n++) 463 e->topindex = oe_find_display_line(e, NULL, e->topindex );466 e->topindex = oe_find_display_line(e, NULL, e->topindex, NULL); 464 467 465 468 oe_restore_excursion(e, &x); … … 483 486 void owl_editwin_redisplay(owl_editwin *e) 484 487 { 485 int x = -1, y = -1, t ;488 int x = -1, y = -1, t, hard; 486 489 int line, index, lineindex, times = 0; 487 490 … … 497 500 lineindex = index; 498 501 t = -1; 499 index = oe_find_display_line(e, &t, lineindex );502 index = oe_find_display_line(e, &t, lineindex, &hard); 500 503 if (x == -1 && t != -1) 501 504 x = t, y = line; … … 518 521 oe_mvaddnec(e, line, 0, oe_region_width(e, lineindex, index, 0)); 519 522 } 523 if (!hard) 524 waddch(e->curswin, '\\'); 520 525 } 521 526 line++;
Note: See TracChangeset
for help on using the changeset viewer.