Changeset 4ccd92c


Ignore:
Timestamp:
Aug 31, 2009, 3:01:12 PM (15 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
0d9c90c
Parents:
94ef58c
git-author:
Nelson Elhage <nelhage@mit.edu> (08/27/09 00:29:50)
git-committer:
Nelson Elhage <nelhage@mit.edu> (08/31/09 15:01:12)
Message:
Make zdots work even if the buffer has trailing whitespace.

Fixes #95.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • editwin.c

    r27f6487 r4ccd92c  
    12021202
    12031203  if (!e->dotsend) return(0);
    1204   if (e->index != e->bufflen) return (0);
     1204  if (!owl_editwin_is_at_end(e)) return (0);
    12051205
    12061206  oe_save_excursion(e, &x);
     
    12081208  owl_editwin_point_move(e, -3);
    12091209
    1210   if(strcmp(e->buff + e->index, "\n.\n") == 0) {
     1210  if(strncmp(e->buff + e->index, "\n.\n", 3) == 0) {
    12111211    owl_editwin_point_move(e, 1);
    12121212    zdot = 1;
    12131213  } else if(e->index == e->lock &&
    1214             strcmp(e->buff + e->index, ".\n") == 0) {
     1214            strncmp(e->buff + e->index, ".\n", 2) == 0) {
    12151215    zdot = 1;
    12161216  }
    12171217
    12181218  if(zdot) {
    1219     owl_editwin_replace(e, 2, "");
     1219    owl_editwin_set_mark(e);
     1220    owl_editwin_move_to_end(e);
     1221    owl_editwin_replace_region(e, "");
    12201222  }
    12211223
Note: See TracChangeset for help on using the changeset viewer.