summaryrefslogtreecommitdiffstats
path: root/source/textbox.c
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2014-09-03 13:07:26 +0200
committerDave Davenport <qball@gmpclient.org>2014-09-03 13:07:26 +0200
commit0462811800e69933a069ac48e471bc6016aae08f (patch)
treec57272b3a755152ffc0df12c767cc38e3707c5b9 /source/textbox.c
parent5f33d506b9e7ef4c78d33d78044f092fb0dfb201 (diff)
Add flexible configuration for launching
* You can now specify links: {terminal} -e bash -e "{ssh-client} {host}" * Add test for this code.
Diffstat (limited to 'source/textbox.c')
-rw-r--r--source/textbox.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/textbox.c b/source/textbox.c
index 9c1dc78e..26fea7f8 100644
--- a/source/textbox.c
+++ b/source/textbox.c
@@ -321,10 +321,11 @@ void textbox_delete ( textbox *tb, int pos, int dlen )
// move everything after pos+dlen down
char *at = tb->text + pos;
// Move remainder + closing \0
- memmove ( at, at + dlen, len - pos-dlen+1 );
- if ( tb->cursor >= pos && tb->cursor < (pos+dlen) ) {
- tb->cursor = pos;
- } else if ( tb->cursor >= (pos+dlen) ) {
+ memmove ( at, at + dlen, len - pos - dlen + 1 );
+ if ( tb->cursor >= pos && tb->cursor < ( pos + dlen ) ) {
+ tb->cursor = pos;
+ }
+ else if ( tb->cursor >= ( pos + dlen ) ) {
tb->cursor -= dlen;
}
}