Changeset f2e36b5


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)
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    raa2f33b3 rf2e36b5  
    11$Id$
    22
     31.2.1-pre-4
     4        Page-down will not skip past the last message if its truncated.
     5        Added C-t binding for transposing characters.  (from jdaniel)
     6       
    371.2.1-pre-3
    48        Variables now have a summary and a long description.
     
    3337                           or bottom of the screen.  When it moves,
    3438                           the screen will be paged up or down and
    35                            the cursor will be near the center.\n",
     39                           the cursor will be near the center.
    3640
    37411.2.1-pre-2
  • commands.c

    r10b866d rf2e36b5  
    570570                  OWL_CTX_EDIT,
    571571                  "deletes all of the contents of the buffer",
     572                  "", ""),
     573
     574  OWLCMD_VOID_CTX("edit:transpose-chars", owl_editwin_transpose_chars,
     575                  OWL_CTX_EDIT,
     576                  "Interchange characters around point, moving forward one character.",
    572577                  "", ""),
    573578
  • 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
  • functions.c

    raa2f33b3 rf2e36b5  
    12461246  i=owl_mainwin_get_last_msg(owl_global_get_mainwin(&g));
    12471247  if (i<0) return;
    1248 
     1248  if (owl_mainwin_is_last_msg_truncated(owl_global_get_mainwin(&g))
     1249      && (owl_global_get_curmsg(&g) < i)
     1250      && (i>0)) {
     1251    i--;
     1252  }
    12491253  owl_global_set_curmsg(&g, i);
    12501254  owl_function_nextmsg();
  • keys.c

    re50cd56 rf2e36b5  
    6969
    7070  BIND_CMD("C-k",         "edit:delete-to-line-end", "");
     71
     72  BIND_CMD("C-t",         "edit:transpose-chars", "");
    7173
    7274  BIND_CMD("M-q",         "edit:fill-paragraph", "");
  • mainwin.c

    r1aee7d9 rf2e36b5  
    4141  isfull=0;
    4242  mw->curtruncated=0;
     43  mw->lasttruncated=0;
    4344  j=owl_view_get_size(v);
    4445  for (i=topmsg; i<j; i++) {
     
    7273    /* if we'll fill the screen print a partial message */
    7374    if ((y+lines > recwinlines) && (i==owl_global_get_curmsg(&g))) mw->curtruncated=1;
     75    if (y+lines > recwinlines) mw->lasttruncated=1;
    7476    if (y+lines > recwinlines-1) {
    7577      isfull=1;
     
    130132}
    131133
     134int owl_mainwin_is_last_msg_truncated(owl_mainwin *mw) {
     135  if (mw->lasttruncated) return(1);
     136  return(0);
     137}
     138
    132139int owl_mainwin_get_last_msg(owl_mainwin *mw) {
    133140  /* return the number of the last message displayed. -1 if none */
  • owl.h

    raa2f33b3 rf2e36b5  
    1212static const char owl_h_fileIdent[] = "$Id$";
    1313
    14 #define OWL_VERSION         1.2.1-pre-3
    15 #define OWL_VERSION_STRING "1.2.1-pre-3"
     14#define OWL_VERSION         1.2.1-pre-4
     15#define OWL_VERSION_STRING "1.2.1-pre-4"
    1616
    1717#define OWL_DEBUG 0
     
    245245typedef struct _owl_mainwin {
    246246  int curtruncated;
     247  int lasttruncated;
    247248  int lastdisplayed;
    248249} owl_mainwin;
Note: See TracChangeset for help on using the changeset viewer.