diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2003-09-23 00:21:28 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2003-09-23 00:21:28 +0000 |
commit | 64fdb009695828b788fce074135b20a5e52c5fc4 (patch) | |
tree | a05144197dd339721b6d4a3a0927f7596e8872b6 /pd/src/g_rtext.c | |
parent | a30193fcd726552364de74984b200be2c30723e7 (diff) |
imported version 0.37-0
svn path=/trunk/; revision=1016
Diffstat (limited to 'pd/src/g_rtext.c')
-rw-r--r-- | pd/src/g_rtext.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/pd/src/g_rtext.c b/pd/src/g_rtext.c index ee894b7e..aeeb5dfd 100644 --- a/pd/src/g_rtext.c +++ b/pd/src/g_rtext.c @@ -229,7 +229,13 @@ static void rtext_senditup(t_rtext *x, int action, int *widthp, int *heightp, sys_vgui(".x%x.c select from %s %d\n", canvas, x->x_tag, x->x_selstart); sys_vgui(".x%x.c select to %s %d\n", canvas, - x->x_tag, x->x_selend); + x->x_tag, x->x_selend +#if defined (MSW) || defined(MACOSX) + /* Why is linux selecting text differently from MSW and OSX??? + Just adjust it here... LATER revisit this one */ + -1 +#endif + ); sys_vgui(".x%x.c focus \"\"\n", canvas); } else @@ -385,18 +391,23 @@ void rtext_key(t_rtext *x, int keynum, t_symbol *keysym) { int n = keynum; if (n == '\r') n = '\n'; - if (n == '\b') + if (n == '\b') /* backspace */ { - if ((!x->x_selstart) && (x->x_selend == x->x_bufsize)) + /* LATER delete the box if all text is selected... + this causes reentrancy problems now. */ + /* if ((!x->x_selstart) && (x->x_selend == x->x_bufsize)) { - /* LATER delete the box... this causes reentrancy - problems now. */ - /* glist_delete(x->x_glist, &x->x_text->te_g); */ - return; - } - else if (x->x_selstart && (x->x_selstart == x->x_selend)) + .... + } */ + if (x->x_selstart && (x->x_selstart == x->x_selend)) x->x_selstart--; } + else if (n == 127) /* delete */ + { + if (x->x_selend < x->x_bufsize && (x->x_selstart == x->x_selend)) + x->x_selend++; + } + ndel = x->x_selend - x->x_selstart; for (i = x->x_selend; i < x->x_bufsize; i++) x->x_buf[i- ndel] = x->x_buf[i]; |