mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-02-23 09:54:19 +03:00
[project @ 2003-10-08 22:01:20 by jmb]
Allow cursor movement between lines in paragraphs svn path=/import/netsurf/; revision=356
This commit is contained in:
parent
4b45cf75a9
commit
6ad8b25cc0
@ -822,7 +822,8 @@ void browser_window_textarea_callback(struct browser_window *bw, char key, void
|
||||
} else if (key == 28) {
|
||||
/* Right cursor -> */
|
||||
if (char_offset == text_box->length &&
|
||||
inline_container->next) {
|
||||
text_box == inline_container->last &&
|
||||
inline_container->next) {
|
||||
if (inline_container->next->children) {
|
||||
/* move to start of next box (if it exists) */
|
||||
text_box = inline_container->next->children;
|
||||
@ -830,6 +831,10 @@ void browser_window_textarea_callback(struct browser_window *bw, char key, void
|
||||
char_offset = 0;
|
||||
inline_container=inline_container->next;
|
||||
}
|
||||
else if (char_offset == text_box->length && text_box->next) {
|
||||
text_box = text_box->next;
|
||||
char_offset == 0;
|
||||
}
|
||||
else if (char_offset != text_box->length) {
|
||||
char_offset++;
|
||||
}
|
||||
@ -838,7 +843,9 @@ void browser_window_textarea_callback(struct browser_window *bw, char key, void
|
||||
}
|
||||
} else if (key == 29) {
|
||||
/* Left cursor <- */
|
||||
if (char_offset == 0 && inline_container->prev) {
|
||||
if (char_offset == 0 &&
|
||||
text_box == inline_container->children &&
|
||||
inline_container->prev) {
|
||||
if (inline_container->prev->children) {
|
||||
/* move to end of previous box */
|
||||
text_box = inline_container->prev->children;
|
||||
@ -846,6 +853,10 @@ void browser_window_textarea_callback(struct browser_window *bw, char key, void
|
||||
inline_container=inline_container->prev;
|
||||
char_offset = text_box->length;
|
||||
}
|
||||
else if (char_offset == 0 && text_box->next) {
|
||||
text_box = text_box->next;
|
||||
char_offset = text_box->length;
|
||||
}
|
||||
else if (char_offset != 0) {
|
||||
char_offset--;
|
||||
}
|
||||
@ -854,7 +865,8 @@ void browser_window_textarea_callback(struct browser_window *bw, char key, void
|
||||
}
|
||||
} else if (key == 30) {
|
||||
/* Up Cursor */
|
||||
if (inline_container->prev) {
|
||||
if (text_box == inline_container->children &&
|
||||
inline_container->prev) {
|
||||
if (inline_container->prev->children) {
|
||||
text_box = inline_container->prev->children;
|
||||
}
|
||||
@ -863,12 +875,19 @@ void browser_window_textarea_callback(struct browser_window *bw, char key, void
|
||||
char_offset = text_box->length;
|
||||
}
|
||||
}
|
||||
else if (text_box->prev) {
|
||||
text_box = text_box->prev;
|
||||
if (char_offset > text_box->length) {
|
||||
char_offset = text_box->length;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
} else if (key == 31) {
|
||||
/* Down cursor */
|
||||
if (inline_container->next) {
|
||||
if (text_box == inline_container->last &&
|
||||
inline_container->next) {
|
||||
if (inline_container->next->children) {
|
||||
text_box = inline_container->next->children;
|
||||
}
|
||||
@ -877,6 +896,12 @@ void browser_window_textarea_callback(struct browser_window *bw, char key, void
|
||||
char_offset = text_box->length;
|
||||
}
|
||||
}
|
||||
else if (text_box->next) {
|
||||
text_box = text_box->next;
|
||||
if (char_offset > text_box->length) {
|
||||
char_offset = text_box->length;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user