Changeset f2e36b5 for editwin.c


Ignore:
Timestamp:
Aug 4, 2002, 6:12:28 PM (22 years ago)
Author:
Erik Nygren <nygren@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
8509c08
Parents:
aa2f33b3
Message:
* Page-down will not skip past the last message if its truncated.
* Added C-t binding for transposing characters.  (from jdaniel)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • editwin.c

    r10b866d rf2e36b5  
    368368}
    369369
     370void owl_editwin_transpose_chars(owl_editwin *e) {
     371  /* Swap the character at point with the character at point-1 and
     372   * advance the pointer.  If point is at beginning of buffer do
     373   * nothing.  If point is after the last character swap point-1 with
     374   * point-2.  (Behaves as observed in tcsh and emacs). 
     375   */
     376
     377  int z;
     378  char tmp;
     379
     380  if (e->bufflen==0) return;
     381 
     382  /* get the cursor point */
     383  z=_owl_editwin_get_index_from_xy(e);
     384
     385  if (z==e->bufflen) {
     386    /* point is after last character */
     387    z--;
     388  } 
     389
     390  if (z-1 < e->lock) {
     391    /* point is at beginning of buffer, do nothing */
     392    return;
     393  }
     394
     395  tmp=e->buff[z];
     396  e->buff[z]=e->buff[z-1];
     397  e->buff[z-1]=tmp;
     398  owl_editwin_key_right(e);
     399}
     400
    370401void owl_editwin_insert_string(owl_editwin *e, char *string) {
    371402  /* insert 'string' at the current point, later text is shifted
Note: See TracChangeset for help on using the changeset viewer.