[Conkeror] [PATCH] unescape current location in the mode line
volh at ginnungagap.in.ua
volh at ginnungagap.in.ua
Thu Oct 30 02:17:18 PDT 2008
Hi. Mode line and find-alternate-url escape current location string.
This makes surfing location like http://ru.wikipedia.org/wiki/Французская_новая_волна quite uncomfortable.
--
wbr, Roman Semenenko.
-------------- next part --------------
diff --git a/modules/commands.js b/modules/commands.js
index 0ac8b69..fc6cc62 100644
--- a/modules/commands.js
+++ b/modules/commands.js
@@ -432,7 +432,7 @@ interactive("find-alternate-url", "Edit the current URL in the minibuffer",
check_buffer (buf, content_buffer);
var result = yield buf.window.minibuffer.read_url (
$prompt = prompt,
- $initial_value = buf.display_URI_string);
+ $initial_value = textToSubURI.unEscapeURIForUI("UTF-8", buf.display_URI_string));
yield co_return (result);
}),
$prompt = "Find url");
diff --git a/modules/mode-line.js b/modules/mode-line.js
index f07a8fa..443c387 100644
--- a/modules/mode-line.js
+++ b/modules/mode-line.js
@@ -141,7 +141,7 @@ function current_buffer_name_widget(window) {
}
current_buffer_name_widget.prototype.__proto__ = text_widget.prototype;
current_buffer_name_widget.prototype.update = function () {
- this.view.text = this.window.buffers.current.description;
+ this.view.text = textToSubURI.unEscapeURIForUI("UTF-8", this.window.buffers.current.description);
};
function current_buffer_scroll_position_widget(window) {
diff --git a/modules/suggest-file-name.js b/modules/suggest-file-name.js
index 267cbd3..6b965d1 100644
--- a/modules/suggest-file-name.js
+++ b/modules/suggest-file-name.js
@@ -134,7 +134,6 @@ function maybe_filename_from_uri(uri) {
var url = uri.QueryInterface(Components.interfaces.nsIURL);
if (url.fileName != "") {
// 2) Use the actual file name, if present
- var textToSubURI = Cc["@mozilla.org/intl/texttosuburi;1"].getService(Ci.nsITextToSubURI);
return textToSubURI.unEscapeURIForUI(url.originCharset || "UTF-8", url.fileName);
}
} catch (e) {
diff --git a/modules/utils.js b/modules/utils.js
index a88d7c0..47f86d2 100644
--- a/modules/utils.js
+++ b/modules/utils.js
@@ -1264,3 +1264,5 @@ function compute_url_up_path (url)
up = "..";
return up;
}
+
+var textToSubURI = Cc["@mozilla.org/intl/texttosuburi;1"].getService(Ci.nsITextToSubURI);
More information about the Conkeror
mailing list