1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 02:37:58 +01:00

minor formatting fixes

This commit is contained in:
Doug Kearns
2007-12-04 08:23:49 +00:00
parent 6ceccfee72
commit a91aec0172
4 changed files with 16 additions and 11 deletions

View File

@@ -375,7 +375,7 @@ vimperator.Editor = function () //{{{
// vimperator.echoerr("External editor returned with exit code " + retcode); // vimperator.echoerr("External editor returned with exit code " + retcode);
// } // }
// else // else
{ // {
try try
{ {
var val = vimperator.io.readFile(tmpfile); var val = vimperator.io.readFile(tmpfile);
@@ -386,7 +386,7 @@ vimperator.Editor = function () //{{{
tmpBg = "red"; tmpBg = "red";
vimperator.echoerr("Could not read from temporary file " + tmpfile.path + ": " + e.message); vimperator.echoerr("Could not read from temporary file " + tmpfile.path + ": " + e.message);
} }
} // }
// blink the textbox after returning // blink the textbox after returning
var timeout = 100; var timeout = 100;

View File

@@ -425,8 +425,8 @@ vimperator.Events = function () //{{{
return (key == "<Esc>" || key == "<C-[>" || key == "<C-c>"); return (key == "<Esc>" || key == "<C-[>" || key == "<C-c>");
}, },
getMapLeader: function () getMapLeader: function ()
{ {
var leaderRef = vimperator.variableReference("mapleader"); var leaderRef = vimperator.variableReference("mapleader");
return leaderRef[0] ? leaderRef[0][leaderRef[1]] : "\\"; return leaderRef[0] ? leaderRef[0][leaderRef[1]] : "\\";
}, },

View File

@@ -1086,9 +1086,9 @@ vimperator.Mappings = function () //{{{
for (var i = 0; i < count; i++) for (var i = 0; i < count; i++)
{ {
if (isDirectory(url)) if (isDirectory(url))
url = url.replace(/^(.*?:)(.*?)([^\/]+\/*)$/, "$1$2/") url = url.replace(/^(.*?:)(.*?)([^\/]+\/*)$/, "$1$2/");
else else
url = url.replace(/^(.*?:)(.*?)(\/+[^\/]+)$/, "$1$2/") url = url.replace(/^(.*?:)(.*?)(\/+[^\/]+)$/, "$1$2/");
} }
url = url.replace(/^(.*:\/+.*?)\/+$/, "$1/"); // get rid of more than 1 / at the end url = url.replace(/^(.*:\/+.*?)\/+$/, "$1/"); // get rid of more than 1 / at the end

View File

@@ -1206,11 +1206,16 @@ vimperator.StatusLine = function () //{{{
var bufferPositionStr = ""; var bufferPositionStr = "";
percent = Math.round(percent * 100); percent = Math.round(percent * 100);
if (percent < 0) bufferPositionStr = "All"; if (percent < 0)
else if (percent == 0) bufferPositionStr = "Top"; bufferPositionStr = "All";
else if (percent < 10) bufferPositionStr = " " + percent + "%"; else if (percent == 0)
else if (percent >= 100) bufferPositionStr = "Bot"; bufferPositionStr = "Top";
else bufferPositionStr = percent + "%"; else if (percent < 10)
bufferPositionStr = " " + percent + "%";
else if (percent >= 100)
bufferPositionStr = "Bot";
else
bufferPositionStr = percent + "%";
bufferPositionWidget.value = bufferPositionStr; bufferPositionWidget.value = bufferPositionStr;
} }