Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- jumanji.c 2010-08-11 12:06:08.000000000 +0000
- +++ jumanji.c.new 2010-08-11 12:06:32.000000000 +0000
- @@ -1619,6 +1619,14 @@
- Jumanji.Global.buffer = temp;
- gtk_label_set_markup((GtkLabel*) Jumanji.Statusbar.buffer, Jumanji.Global.buffer->str);
- }
- + /* Make sure the follower script gets known of the buffer change */
- + if(Jumanji.Global.mode == FOLLOW)
- + {
- + /* not sure if there will be side effects by the NULL value
- + * but it will not be used in this case after all */
- + Argument argument = {0, NULL};
- + sc_follow_link(&argument);
- + }
- }
- }
- @@ -1713,20 +1721,62 @@
- else
- cmd = g_strdup("focus_next()");
- }
- - else if(Jumanji.Global.buffer && Jumanji.Global.buffer->len > 0)
- - cmd = g_strconcat("update_hints(\"", Jumanji.Global.buffer->str, "\")", NULL);
- + else if(Jumanji.Global.buffer)
- + {
- + if(Jumanji.Global.buffer->len > 0)
- + {
- + cmd = g_strconcat("update_hints(\"", Jumanji.Global.buffer->str, "\")", NULL);
- + }
- + else if(Jumanji.Global.buffer->len == 0)
- + {
- + /* probably not needed actually (see below), just for being sure */
- + cmd = g_strconcat("update_hints(\"", "", "\")", NULL);
- + }
- + }
- + else
- + {
- + /* jumanji removes the buffer if it gets cleared on a delete operation
- + * (hopefully there are no nasty side effects) */
- + cmd = g_strconcat("update_hints(\"", "", "\")", NULL);
- + }
- run_script(cmd, &value, NULL);
- g_free(cmd);
- if(value && strcmp(value, "undefined"))
- {
- - if(open_mode == -1)
- - open_uri(GET_CURRENT_TAB(), value);
- + /* Was there a buffer reset special command returned? */
- + if(value[0] == '\\')
- + {
- + /* Clear and remove the global buffer if it exists. */
- + if(Jumanji.Global.buffer)
- + {
- + g_string_free(Jumanji.Global.buffer, TRUE);
- + Jumanji.Global.buffer = NULL;
- + gtk_label_set_markup((GtkLabel*) Jumanji.Statusbar.buffer, "");
- + }
- + if(strlen(value) > 1)
- + {
- + /* Moreover: was there a mode change command returned? */
- + if(value[1] == '\\')
- + {
- + /* clear modes */
- + change_mode(NORMAL);
- + gtk_widget_hide(GTK_WIDGET(Jumanji.UI.inputbar));
- + webkit_web_view_unmark_text_matches(GET_CURRENT_TAB());
- + }
- + }
- + }
- else
- - create_tab(value, TRUE);
- + {
- + /* There has been an address returned. Go there. */
- + if(open_mode == -1)
- + open_uri(GET_CURRENT_TAB(), value);
- + else
- + create_tab(value, TRUE);
- - sc_abort(NULL);
- + sc_abort(NULL);
- + }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment