mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 23:57:59 +01:00
process link text only find modifiers \[uU] before looking for capitalized
letters when 'smartcase' is set
This commit is contained in:
@@ -70,6 +70,19 @@ function Search() //{{{
|
|||||||
|
|
||||||
search_pattern = pattern;
|
search_pattern = pattern;
|
||||||
|
|
||||||
|
// links only search - \u wins if both modifiers specified
|
||||||
|
if (/\\u/.test(pattern))
|
||||||
|
links_only = false;
|
||||||
|
else if (/\U/.test(pattern))
|
||||||
|
links_only = true;
|
||||||
|
else if (vimperator.options["linksearch"])
|
||||||
|
links_only = true;
|
||||||
|
else
|
||||||
|
links_only = false;
|
||||||
|
|
||||||
|
// strip links-only modifiers
|
||||||
|
pattern = pattern.replace(/(\\)?\\[uU]/g, function($0, $1) { return $1 ? $0 : "" });
|
||||||
|
|
||||||
// case sensitivity - \c wins if both modifiers specified
|
// case sensitivity - \c wins if both modifiers specified
|
||||||
if (/\c/.test(pattern))
|
if (/\c/.test(pattern))
|
||||||
case_sensitive = false;
|
case_sensitive = false;
|
||||||
@@ -82,20 +95,10 @@ function Search() //{{{
|
|||||||
else
|
else
|
||||||
case_sensitive = true;
|
case_sensitive = true;
|
||||||
|
|
||||||
// links only search - \u wins if both modifiers specified
|
// strip case-sensitive modifiers
|
||||||
if (/\\u/.test(pattern))
|
pattern = pattern.replace(/(\\)?\\[cC]/g, function($0, $1) { return $1 ? $0 : "" });
|
||||||
links_only = false;
|
|
||||||
else if (/\U/.test(pattern))
|
|
||||||
links_only = true;
|
|
||||||
else if (vimperator.options["linksearch"])
|
|
||||||
links_only = true;
|
|
||||||
else
|
|
||||||
links_only = false;
|
|
||||||
|
|
||||||
// strip modifiers
|
// remove any modifer escape \
|
||||||
pattern = pattern.replace(/(\\)?\\[cCuU]/g, function($0, $1) { return $1 ? $0 : "" });
|
|
||||||
|
|
||||||
// remove the modifer escape \
|
|
||||||
pattern = pattern.replace(/\\(\\[cCuU])/g, '$1')
|
pattern = pattern.replace(/\\(\\[cCuU])/g, '$1')
|
||||||
|
|
||||||
search_string = pattern;
|
search_string = pattern;
|
||||||
|
|||||||
Reference in New Issue
Block a user