From 6605e4fa1927d7179a44525b8b5b86d3ccbabf2a Mon Sep 17 00:00:00 2001 From: Martin Stubenschrott Date: Wed, 9 Jan 2008 17:50:47 +0000 Subject: [PATCH] y can yank the selection in visual caret mode now --- TODO | 3 +++ content/mappings.js | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index b164dc40..dd585752 100644 --- a/TODO +++ b/TODO @@ -16,6 +16,9 @@ FEATURES: 8 add more autocommands (BrowserStart, BrowserQuit, TabClose, TabOpen, TabChanged, LocationChanged, any more?) 8 ;? will show information about like id, class, image filename, etc. 8 there should be a listbox/combobox mode +8 y and Y should be changed to: yy and yl=yank location, ys=yank selection, + yd=yank domain name, yt=yank title, yw=yank current word, + yS=yank selection, if no selection then yank current word (other things to yank?) 7 use ctrl-n/p in insert mode for word completion 7 implement LocationList window, and get rid off/change PreviewWindow to be a real preview window being able to display html pages 7 [ctrl-o/i] to Go back to a Previous Position (done partly, however currenty does not use a per tab jumplist) diff --git a/content/mappings.js b/content/mappings.js index ea49281f..af824047 100644 --- a/content/mappings.js +++ b/content/mappings.js @@ -844,7 +844,7 @@ vimperator.Mappings = function () //{{{ help: "When running in X11 the location is also put into the selection, which can be pasted with the middle mouse button." } )); - addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["Y"], + addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL, vimperator.modes.VISUAL], ["Y"], function () { var sel = window.content.document.getSelection(); @@ -1676,7 +1676,13 @@ vimperator.Mappings = function () //{{{ vimperator.modes.set(vimperator.modes.TEXTAREA); } else - vimperator.beep(); // TODO: yanking is possible for caret mode + { + var sel = window.content.document.getSelection(); + if (sel) + vimperator.copyToClipboard(sel, true); + else + vimperator.beep(); + } }, { } ));