Changeset 2fc8397 for editwin.c


Ignore:
Timestamp:
Jul 11, 2009, 1:14:36 PM (12 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
19a023f
Parents:
77f605d
git-author:
Nelson Elhage <nelhage@mit.edu> (07/06/09 20:41:51)
git-committer:
Nelson Elhage <nelhage@mit.edu> (07/11/09 13:14:36)
Message:
Implement {forward,backward}-paragraph
File:
1 edited

Legend:

Unmodified
Added
Removed
  • editwin.c

    r77f605d r2fc8397  
    10501050}
    10511051
     1052void owl_editwin_backward_paragraph(owl_editwin *e)
     1053{
     1054  owl_editwin_point_move(e, -1);
     1055  for (; e->index >= e->lock; owl_editwin_point_move(e, -1)) {
     1056    if (e->index <= e->lock ||
     1057        ((e->buff[e->index] == '\n') && (e->buff[e->index - 1]=='\n')))
     1058      break;
     1059  }
     1060}
     1061
     1062void owl_editwin_forward_paragraph(owl_editwin *e)
     1063{
     1064  owl_editwin_point_move(e, 1);
     1065  /* scan forward to the start of the next paragraph */
     1066  for(; e->index < e->bufflen; owl_editwin_point_move(e, 1)) {
     1067    if (e->buff[e->index -1] == '\n' && e->buff[e->index] == '\n')
     1068      break;
     1069  }
     1070}
     1071
    10521072static int oe_display_column(owl_editwin *e)
    10531073{
Note: See TracChangeset for help on using the changeset viewer.