From: Daniel Carl Date: Mon, 28 Oct 2013 22:08:48 +0000 (+0100) Subject: Fixed none working prev/next patterns (#50). X-Git-Url: https://git.owens.tech///git?a=commitdiff_plain;h=d70d4b172a3b68e3bc5bb5f4275331c6c51b0e6a;p=vimb.git Fixed none working prev/next patterns (#50). The prev/next pattern did not work properly because of the surrounding single quotes. Additional to this they where case sensitive and did not match very well. So the default pattern where reformulated with plain JavaScript regex syntax and 'i' flag for none case sensitive matching. --- diff --git a/doc/vimb.1 b/doc/vimb.1 index 247a187..a753dd2 100644 --- a/doc/vimb.1 +++ b/doc/vimb.1 @@ -705,12 +705,12 @@ Font used for inputbox. .B nextpattern (string) Patterns to use when guessing the next page in a document. Each pattern is successively tested against each link in the page beginning from the last -link. Default "'\\bnext\\b','^(>|>>|»)$','^(>|>>|»)','(>|>>|»)$','\\bmore\\b'" +link. Default "/\\bnext\\b/i,/^(>|>>|»)$/,/^(>|>>|»)/,/(>|>>|»)$/,/\\bmore\\b/i" .TP .B previouspattern (string) Patterns to use when guessing the previous page in a document. Each pattern is successively tested against each link in the page beginning from the last -link. Default "\\bprev|previous\\b','^(<|<<|«)$','^(<|<<|«)','(<|<<|«)$'" +link. Default "/\\bnext\\b/i,/^(>|>>|»)$/,/^(>|>>|»)/,/(>|>>|»)$/,/\\bmore\\b/i" .TP .B proxy (bool) Indicates if the environment variable `http_proxy' is evaluated. diff --git a/src/default.h b/src/default.h index 8b97abf..617de83 100644 --- a/src/default.h +++ b/src/default.h @@ -67,8 +67,8 @@ static char *default_config[] = { "set insecure-content-run=off", #endif "set timeoutlen=1000", - "set previouspattern='\\bprev\\|previous\\b','^(<\\|<<\\|«)$','^(<\\|<<\\|«)','(<\\|<<\\|«)$'", - "set nextpattern='\\bnext\\b','^(>\\|>>\\|»)$','^(>\\|>>\\|»)','(>\\|>>\\|»)$','\\bmore\\b'", + "set previouspattern=/\\bprev\\|previous\\b/i,/^(<\\|<<\\|«)$/,/^(<\\|<<\\|«)/,/(<\\|<<\\|«)$/", + "set nextpattern=/\\bnext\\b/i,/^(>\\|>>\\|»)$/,/^(>\\|>>\\|»)/,/(>\\|>>\\|»)$/,/\\bmore\\b/i", NULL }; diff --git a/src/hints.c b/src/hints.c index fe7cda1..8f575ca 100644 --- a/src/hints.c +++ b/src/hints.c @@ -173,7 +173,6 @@ void hints_follow_link(const gboolean back, int count) static void run_script(char *js) { - PRINT_DEBUG("%s", js); char mode, *value = NULL; gboolean success = vb_eval_script(