gboolean success;
Command command = NULL;
Arg arg = {0};
+
+ vb_set_mode(VB_MODE_NORMAL | (vb.state.mode & VB_MODE_SEARCH), false);
if (!command_parse_from_string(input, &command, &arg, &vb.state.count)) {
return false;
}
success = command(&arg);
g_free(arg.s);
-
+
return success;
}
gboolean command_view_source(const Arg *arg)
{
- vb_set_mode(VB_MODE_NORMAL, false);
-
gboolean mode = webkit_web_view_get_view_source_mode(vb.gui.webview);
webkit_web_view_set_view_source_mode(vb.gui.webview, !mode);
webkit_web_view_reload(vb.gui.webview);
gboolean command_navigate(const Arg *arg)
{
int count = vb.state.count ? vb.state.count : 1;
- vb_set_mode(VB_MODE_NORMAL, false);
WebKitWebView *view = vb.gui.webview;
if (arg->i <= VB_NAVIG_FORWARD) {
int direction = (arg->i & (1 << 2)) ? 1 : -1;
GtkAdjustment *adjust = (arg->i & VB_SCROLL_AXIS_H) ? vb.gui.adjust_h : vb.gui.adjust_v;
- /* keep possible search mode */
- vb_set_mode(VB_MODE_NORMAL | (vb.state.mode & VB_MODE_SEARCH), false);
-
max = gtk_adjustment_get_upper(adjust) - gtk_adjustment_get_page_size(adjust);
/* type scroll */
if (arg->i & VB_SCROLL_TYPE_SCROLL) {
{
char *key;
- vb_set_mode(VB_MODE_NORMAL, false);
-
if (!arg->s) {
return false;
}
gboolean command_unmap(const Arg *arg)
{
- vb_set_mode(VB_MODE_NORMAL, false);
-
return keybind_remove_from_string(arg->s, arg->i);
}
gboolean success;
char *param = NULL, *line = NULL;
- vb_set_mode(VB_MODE_NORMAL, false);
if (!arg->s || *(arg->s) == '\0') {
return false;
}
gboolean enabled;
WebKitWebSettings *settings = NULL;
- vb_set_mode(VB_MODE_NORMAL, false);
-
settings = webkit_web_view_get_settings(vb.gui.webview);
g_object_get(G_OBJECT(settings), "enable-developer-extras", &enabled, NULL);
if (enabled) {
gboolean command_yank(const Arg *arg)
{
- vb_set_mode(VB_MODE_NORMAL, true);
-
if (arg->i & COMMAND_YANK_SELECTION) {
char *text = NULL;
/* copy current selection to clipboard */
{
gboolean result;
- vb_set_mode(VB_MODE_NORMAL, false);
-
if (arg->i) {
char *handle;
gboolean command_shortcut_default(const Arg *arg)
{
- vb_set_mode(VB_MODE_NORMAL, false);
-
return shortcut_set_default(arg->s);
}
float step, level;
int count = vb.state.count ? vb.state.count : 1;
- vb_set_mode(VB_MODE_NORMAL, false);
-
if (arg->i & COMMAND_ZOOM_RESET) {
webkit_web_view_set_zoom_level(vb.gui.webview, 1.0);
gboolean command_bookmark(const Arg *arg)
{
- vb_set_mode(VB_MODE_NORMAL, false);
-
bookmark_add(GET_URI(), arg->s);
return true;
}
gboolean success;
char *value = NULL;
- vb_set_mode(VB_MODE_NORMAL, false);
-
success = vb_eval_script(
webkit_web_view_get_main_frame(vb.gui.webview), arg->s, NULL, &value
);
const char *uri, *p = NULL, *domain = NULL;
uri = GET_URI();
-
- vb_set_mode(VB_MODE_NORMAL, false);
if (!uri || *uri == '\0') {
return false;
}
WebKitDownload *download;
const char *uri, *path = NULL;
- vb_set_mode(VB_MODE_NORMAL, false);
if (arg->i == COMMAND_SAVE_CURRENT) {
uri = GET_URI();
/* given string is the path to save the download to */
int status, argc;
char *cmd, *exp, *error = NULL, *out = NULL, **argv;
- vb_set_mode(VB_MODE_NORMAL, false);
if (!arg->s || *(arg->s) == '\0') {
return false;
}