summaryrefslogtreecommitdiff
path: root/desktop/textinput.c
diff options
context:
space:
mode:
authorFran├žois Revel <mmu_man@netsurf-browser.org>2008-07-29 09:28:45 +0000
committerFran├žois Revel <mmu_man@netsurf-browser.org>2008-07-29 09:28:45 +0000
commit34e0f4db3fa7994614e37be9973a7e1ef593b0be (patch)
tree57998abd172a009495c36770f2fae347f2ac1b94 /desktop/textinput.c
parentd49fc659235759fd8f09a02ae8bdca7a61af5f0b (diff)
downloadnetsurf-34e0f4db3fa7994614e37be9973a7e1ef593b0be.tar.gz
netsurf-34e0f4db3fa7994614e37be9973a7e1ef593b0be.tar.bz2
- C89 again
- include beos options for BeOS svn path=/trunk/netsurf/; revision=4794
Diffstat (limited to 'desktop/textinput.c')
-rw-r--r--desktop/textinput.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/desktop/textinput.c b/desktop/textinput.c
index fa7ea443a..cb642132f 100644
--- a/desktop/textinput.c
+++ b/desktop/textinput.c
@@ -618,11 +618,12 @@ bool browser_window_textarea_callback(struct browser_window *bw,
case KEY_WORD_LEFT:
{
+ bool start_of_word;
/* if there is a selection, caret should stay at beginning */
if (selection_exists)
break;
- bool start_of_word = (char_offset <= 0 ||
+ start_of_word = (char_offset <= 0 ||
isspace(text_box->text[char_offset - 1]));
while (!word_left(text_box->text, &char_offset, NULL)) {
@@ -652,13 +653,14 @@ bool browser_window_textarea_callback(struct browser_window *bw,
case KEY_WORD_RIGHT:
{
+ bool in_word;
/* if there is a selection, caret should move to the end */
if (selection_exists) {
text_box = selection_get_end(bw->sel, &char_offset);
break;
}
- bool in_word = (char_offset < text_box->length &&
+ in_word = (char_offset < text_box->length &&
!isspace(text_box->text[char_offset]));
while (!word_right(text_box->text, text_box->length,
@@ -1822,13 +1824,13 @@ bool delete_handler(struct browser_window *bw, struct box *b,
void delete_selection(struct selection *s)
{
- assert(s->defined);
size_t start_offset, end_offset;
struct box *text_box = selection_get_start(s, &start_offset);
struct box *end_box = selection_get_end(s, &end_offset);
struct box *next;
size_t sel_len = s->end_idx - s->start_idx;
int beginning = 0;
+ assert(s->defined);
/* Clear selection so that deletion from textboxes proceeds */
selection_clear(s, true);