modules/mode-line.js |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/modules/mode-line.js b/modules/mode-line.js
index 1917159..0d451dc 100644
--- a/modules/mode-line.js
+++ b/modules/mode-line.js
@@ -144,6 +144,20 @@ current_buffer_name_widget.prototype.update = function
() {
     this.view.text = this.window.buffers.current.description;
 };

+function window_size_widget(window){
+  this.name = "window-size-widget";
+  text_widget.call(this, window);
+  this.add_hook("current_content_buffer_location_change_hook");
+  this.add_hook("select_buffer_hook");
+}
+window_size_widget.prototype.__proto__ = text_widget.prototype;
+window_size_widget.prototype.update = function() {
+  var topwin = this.window;
+  w = topwin.innerWidth;
+  h = topwin.innerHeight;
+  this.view.text = "[" + w + "x" + h + "]";
+};
+
 function current_buffer_scroll_position_widget(window) {
     this.name = "current-buffer-scroll-position-widget";
     text_widget.call(this, window);
@@ -197,8 +211,10 @@ function mode_line_adder(widget_constructor) {
     return function (window) { window.mode_line.add_text_widget(new
widget_constructor(window)); }
 }

+add_hook("mode_line_hook", mode_line_adder(window_size_widget));
 add_hook("mode_line_hook", mode_line_adder(current_buffer_name_widget));
 add_hook("mode_line_hook", mode_line_adder(clock_widget));
 add_hook("mode_line_hook",
mode_line_adder(current_buffer_scroll_position_widget));

+
 mode_line_mode(true);
-- 
1.5.5.1
_______________________________________________
Conkeror mailing list
[email protected]
https://www.mozdev.org/mailman/listinfo/conkeror

Reply via email to