Skip to content

Commit

Permalink
switchable between view, viewline and caret mode
Browse files Browse the repository at this point in the history
  • Loading branch information
tuanbass authored and philc committed Oct 17, 2022
1 parent bb9ab6d commit 5ae84b4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions content_scripts/mode_visual.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,8 @@ VisualMode.prototype.movements = {
"Y"(count) { this.movement.selectLine(count); return this.yank(); },
"p"() { return chrome.runtime.sendMessage({handler: "openUrlInCurrentTab", url: this.yank()}); },
"P"() { return chrome.runtime.sendMessage({handler: "openUrlInNewTab", url: this.yank()}); },
"v"() { return new VisualMode; },
"V"() { return new VisualLineMode; },
"v"() { return new VisualMode().init(); },
"V"() { return new VisualLineMode().init(); },
"c"() {
// If we're already in caret mode, or if the selection looks the same as it would in caret mode, then
// callapse to anchor (so that the caret-mode selection will seem unchanged). Otherwise, we're in visual
Expand All @@ -396,7 +396,7 @@ VisualMode.prototype.movements = {
this.movement.collapseSelectionToAnchor();
else
this.movement.collapseSelectionToFocus();
return new CaretMode;
return new CaretMode().init();
},
"o"() { return this.movement.reverseSelection(); }
};
Expand Down

0 comments on commit 5ae84b4

Please sign in to comment.