Skip to content

Commit 2bea2e4

Browse files
authored
Merge branch 'philc:master' into feat/move-tab-to-existing-window
2 parents 278829e + 6d458e6 commit 2bea2e4

20 files changed

+610
-224
lines changed

CHANGELOG.md

+12-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
2.1.3 (unreleased)
1+
2.2.1 (2025-03-20)
22

3+
- Fix findSelected and findSelectedBackwards commands (https://github.com/philc/vimium/issues/4655)
4+
- Fix openCopiedUrlInCurrentTab (https://github.com/philc/vimium/issues/4654)
5+
6+
2.2.0 (2025-03-08)
7+
8+
- Use the browser's default search engine. [(#2598)](https://github.com/philc/vimium/issues/2598)
9+
- Add "reload hard" command (R). ([#4445](https://github.com/philc/vimium/pull/4445)).
10+
- Add zoomIn (zi), zoomOut (zo), zoomReset (z0), and setZoom commands.
11+
([#4488](https://github.com/philc/vimium/pull/4488))
312
- Add findSelected and findSelectedBackwards commands.
413
([#4502](https://github.com/philc/vimium/pull/4502))
5-
- Add commands zoomIn, zoomOut, zoomReset (zi, zo, z0), and setZoom.
6-
([#4488](https://github.com/philc/vimium/pull/4488))
7-
- Add "reload hard" command (bound to R). ([#4445](https://github.com/philc/vimium/pull/4445)).
8-
- Options page: improve UX, add error validation.
14+
- Options page: improve UI, add error validation.
915
- Make tab commands handle Firefox hidden tabs.
1016
- Bug fixes.
1117

@@ -60,7 +66,7 @@
6066
- Fix exception when migrating some pre-v2.0 settings.
6167
([#4323](https://github.com/philc/vimium/issues/4323))
6268

63-
2.0.0 (2023-09-28 -- partially rolled out to users on the Chrome store)
69+
2.0.0 (2023-09-28)
6470

6571
- Support manifest v3, as now required by Chrome. This involved a partial rewrite and many changes.
6672
Please report any new issues [here](https://github.com/philc/vimium/issues).

background_scripts/completion.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -523,13 +523,18 @@ class SearchEngineCompleter {
523523
CompletionSearch.cancel();
524524
}
525525

526-
// TODO(philc): Consider moving to UserSearchEngines
526+
// Returns the UserSearchEngine for the given query. Returns null if the query does not begin with
527+
// a keyword from one of the user's search engines.
527528
getUserSearchEngineForQuery(query) {
528529
const parts = query.trimStart().split(/\s+/);
529530
// For a keyword "w", we match "w search terms" and "w ", but not "w" on its own.
530-
if (parts.length <= 1) return;
531531
const keyword = parts[0];
532-
return UserSearchEngines.keywordToEngine[keyword];
532+
if (parts.length <= 1) return null;
533+
// Don't match queries for built-in properties like "constructor". See #4396.
534+
if (Object.hasOwn(UserSearchEngines.keywordToEngine, keyword)) {
535+
return UserSearchEngines.keywordToEngine[keyword];
536+
}
537+
return null;
533538
}
534539

535540
refresh() {

content_scripts/hud.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const HUD = {
2525
hideFindMode: this.hideFindMode,
2626
search: this.search,
2727
unfocusIfFocused: this.unfocusIfFocused,
28-
paseResponse: this.pasteResponse,
28+
pasteResponse: this.pasteResponse,
2929
showClipboardUnavailableMessage: this.showClipboardUnavailableMessage,
3030
};
3131
const handler = handlers[data.name];

content_scripts/mode_find.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ const getCurrentRange = function () {
401401
range.setStart(document.body, 0);
402402
range.setEnd(document.body, 0);
403403
return range;
404-
}
404+
}
405405

406406
if (selection.type === "Range") {
407407
selection.collapseToStart();

content_scripts/mode_normal.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ const enterNormalMode = function (count) {
7575
return mode;
7676
};
7777

78+
function findSelectedHelper(backwards) {
79+
const selection = window.getSelection().toString();
80+
if (!selection) return;
81+
FindMode.updateQuery(selection);
82+
FindMode.saveQuery();
83+
FindMode.findNext(backwards);
84+
}
85+
7886
const NormalModeCommands = {
7987
// Scrolling.
8088
scrollToBottom() {
@@ -216,14 +224,6 @@ const NormalModeCommands = {
216224
}
217225
},
218226

219-
findSelectedHelper(backwards) {
220-
const selection = window.getSelection().toString();
221-
if (!selection) return;
222-
FindMode.updateQuery(selection);
223-
FindMode.saveQuery();
224-
return FindMode.findNext(backwards);
225-
},
226-
227227
findSelected() {
228228
findSelectedHelper(false);
229229
},

deno.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
"lineWidth": 100
44
},
55
"imports": {
6-
"@b-fuze/deno-dom": "jsr:@b-fuze/deno-dom@^0.1.48",
6+
"@b-fuze/deno-dom": "jsr:@b-fuze/deno-dom@^0.1.49",
77
"@std/fs": "jsr:@std/fs@^1.0.8",
88
"@std/http": "jsr:@std/http@^1.0.12",
99
"@std/path": "jsr:@std/path@^1.0.8",
10+
"jsdom": "npm:jsdom@^26.0.0",
1011
"json5": "npm:json5@^2.2.3"
1112
}
1213
}

0 commit comments

Comments
 (0)