mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-24 15:29:45 +03:00
Further url completion fixes
svn path=/trunk/netsurf/; revision=2744
This commit is contained in:
parent
1fcceb72f6
commit
652f594cbb
@ -1265,8 +1265,8 @@ bool urldb_iterate_partial_path(const struct path_data *parent,
|
||||
/* didn't match, but may be more */
|
||||
continue;
|
||||
else if (c > 0)
|
||||
/* no more possible matches */
|
||||
break;
|
||||
/* still possible matches in a different case */
|
||||
continue;
|
||||
|
||||
/* prefix matches so far */
|
||||
if (slash == end) {
|
||||
|
@ -86,7 +86,6 @@ bool ro_gui_url_complete_keypress(struct gui_window *g, int key)
|
||||
char *url;
|
||||
int i, lines;
|
||||
int old_selection;
|
||||
bool ignore_changes = false;
|
||||
int height;
|
||||
os_error *error;
|
||||
bool currently_open;
|
||||
@ -126,15 +125,9 @@ bool ro_gui_url_complete_keypress(struct gui_window *g, int key)
|
||||
return false;
|
||||
}
|
||||
|
||||
/* check if we should ignore text changes */
|
||||
if ((url_complete_keypress_selection >= 0) && (url_complete_matches))
|
||||
ignore_changes = !strcmp(url,
|
||||
url_complete_matches[
|
||||
url_complete_keypress_selection]);
|
||||
|
||||
/* if the text to match has changed then update it */
|
||||
if (!ignore_changes && ((!url_complete_matched_string) ||
|
||||
(strcmp(match_url, url_complete_matched_string)))) {
|
||||
if ((!url_complete_matched_string) ||
|
||||
(strcmp(match_url, url_complete_matched_string))) {
|
||||
|
||||
/* memorize the current matches */
|
||||
lines = MAXIMUM_VISIBLE_LINES;
|
||||
@ -181,7 +174,8 @@ bool ro_gui_url_complete_keypress(struct gui_window *g, int key)
|
||||
urldb_iterate_entries(url_complete_callback);
|
||||
else
|
||||
urldb_iterate_partial(match_url, url_complete_callback);
|
||||
if (url_complete_memory_exhausted) {
|
||||
if ((url_complete_memory_exhausted) ||
|
||||
(url_complete_matches_available == 0)) {
|
||||
ro_gui_url_complete_close(NULL, 0);
|
||||
return false;
|
||||
}
|
||||
@ -295,6 +289,9 @@ bool ro_gui_url_complete_keypress(struct gui_window *g, int key)
|
||||
ICON_TOOLBAR_URL,
|
||||
url_complete_matches[
|
||||
url_complete_matches_selection]);
|
||||
free(url_complete_matched_string);
|
||||
url_complete_matched_string = strdup(url_complete_matches[
|
||||
url_complete_matches_selection]);
|
||||
}
|
||||
url_complete_keypress_selection = url_complete_matches_selection;
|
||||
|
||||
|
@ -2118,20 +2118,24 @@ bool ro_gui_window_keypress(struct gui_window *g, int key, bool toolbar)
|
||||
BROWSER_NAVIGATE_STOP, false);
|
||||
|
||||
case 8: /* CTRL+H / Backspace */
|
||||
if (!ro_gui_ctrl_pressed() && !toolbar) {
|
||||
/* Backspace */
|
||||
if (ro_gui_shift_pressed()) {
|
||||
return ro_gui_menu_handle_action(
|
||||
g->window,
|
||||
BROWSER_NAVIGATE_FORWARD,
|
||||
false);
|
||||
}
|
||||
else {
|
||||
return ro_gui_menu_handle_action(
|
||||
g->window,
|
||||
BROWSER_NAVIGATE_BACK,
|
||||
false);
|
||||
if (!toolbar) {
|
||||
if (!ro_gui_ctrl_pressed()) {
|
||||
/* Backspace */
|
||||
if (ro_gui_shift_pressed()) {
|
||||
return ro_gui_menu_handle_action(
|
||||
g->window,
|
||||
BROWSER_NAVIGATE_FORWARD,
|
||||
false);
|
||||
}
|
||||
else {
|
||||
return ro_gui_menu_handle_action(
|
||||
g->window,
|
||||
BROWSER_NAVIGATE_BACK,
|
||||
false);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return ro_gui_url_complete_keypress(g, key);
|
||||
}
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user