Skip to content

Commit a6dd02c

Browse files
authored
Merge pull request #31 from unsecretised/search-fix
strip question marks at the end when searching
2 parents e0556c3 + 8c25cf0 commit a6dd02c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/commands.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@ impl Function {
4141
Function::GoogleSearch(query_string) => {
4242
let query_args = query_string.replace(" ", "+");
4343
let query = config.search_url.replace("%s", &query_args);
44+
let query = query.strip_suffix("?").unwrap_or(&query);
4445
NSWorkspace::new().openURL(
4546
&NSURL::URLWithString_relativeToURL(
46-
&objc2_foundation::NSString::from_str(&query),
47+
&objc2_foundation::NSString::from_str(query),
4748
None,
4849
)
4950
.unwrap(),

0 commit comments

Comments
 (0)