From 5ae84b4c30d446812cd199432752222e74d9e83b Mon Sep 17 00:00:00 2001 From: Tuan Bui Date: Wed, 4 Aug 2021 10:22:41 +0700 Subject: [PATCH] switchable between view, viewline and caret mode --- content_scripts/mode_visual.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content_scripts/mode_visual.js b/content_scripts/mode_visual.js index 96d576bef..06cd53194 100644 --- a/content_scripts/mode_visual.js +++ b/content_scripts/mode_visual.js @@ -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 @@ -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(); } };