From e3a2df403dcd41dd2dcf0dbae7e0483c92938582 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Sat, 28 Aug 2010 18:02:03 -0400 Subject: [PATCH] Improve behavior of gf. Remove "|" alias. --- common/content/buffer.js | 13 +++++++------ common/locale/en-US/buffer.xml | 16 ++-------------- common/locale/en-US/index.xml | 7 +------ pentadactyl/NEWS | 2 ++ 4 files changed, 12 insertions(+), 26 deletions(-) diff --git a/common/content/buffer.js b/common/content/buffer.js index 803fed09..6c26c87b 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -940,7 +940,12 @@ const Buffer = Module("buffer", { url = url.substr(PREFIX.length); else url = PREFIX + url; - dactyl.open(url, { hide: true }); + + let sh = history.session; + if (sh[sh.index].URI.spec == url) + window.getWebNavigation().gotoIndex(sh.index); + else + dactyl.open(url, { hide: true }); } }, @@ -1470,17 +1475,13 @@ const Buffer = Module("buffer", { { count: true }); mappings.add(myModes, ["gf"], - "View source", + "Toggle between rendered and source view", function () { buffer.viewSource(null, false); }); mappings.add(myModes, ["gF"], "View source with an external editor", function () { buffer.viewSource(null, true); }); - mappings.add(myModes, ["|"], - "Toggle between rendered and source view", - function () { buffer.viewSource(null, false); }); - mappings.add(myModes, ["gi"], "Focus last used input field", function (count) { diff --git a/common/locale/en-US/buffer.xml b/common/locale/en-US/buffer.xml index 7daff506..d224799f 100644 --- a/common/locale/en-US/buffer.xml +++ b/common/locale/en-US/buffer.xml @@ -51,8 +51,8 @@ gf

- View source. Opens the source code of the current web site with the internal - editor in the current tab. + View source. Toggles between the source and rendered + content of the page.

@@ -84,18 +84,6 @@ - - | - | - -

- Toggle between rendered and source view. Alternates the page in the current tab - between a normally rendered view and the internal editor source view. -

-
-
- -

Motion commands

diff --git a/common/locale/en-US/index.xml b/common/locale/en-US/index.xml index 3f91379c..2c24c6b1 100644 --- a/common/locale/en-US/index.xml +++ b/common/locale/en-US/index.xml @@ -120,11 +120,6 @@ This file contains a list of all available commands, mappings and options. -
-
\
Toggle between rendered and source view
-
- -
/
Search forward for a pattern
?
Search backwards for a pattern
@@ -174,7 +169,7 @@ This file contains a list of all available commands, mappings and options.
gT
Go to previous tab
gU
Go to the root of the website
gb
Repeat last :buffer! command
-
gf
View source
+
gf
Toggle between rendered and source view
gg
Go to the top of the document
gh
Open homepage
gi
Focus last used input field
diff --git a/pentadactyl/NEWS b/pentadactyl/NEWS index 96592f16..351c91f5 100755 --- a/pentadactyl/NEWS +++ b/pentadactyl/NEWS @@ -1,6 +1,8 @@ 2009-XX-XX: * Replaced 'focuscontent' with 'strictfocus' * Replaced previous incremental search implementation + * gf now toggles between source and content view. + '|' key binding has been removed. * :open now only opens files begining with / or ./ * Page zoom information is now shown in the status bar * Added ZO, ZI, ZM, and ZR as aliases for zO, zI, zM, and zR