diff options
author | Gareth Parker <gareth@brainnwave.com> | 2019-06-20 17:01:26 +0100 |
---|---|---|
committer | Gareth Parker <gareth@brainnwave.com> | 2019-06-20 17:04:41 +0100 |
commit | d1b185b4bb1bf7fe3649fd679e7800e84b527842 (patch) | |
tree | 21573a991f8ec4434f494a186d0814fff5dbae01 /python3 | |
parent | 205f848d819b063ef229273f28c0b4a570c5934e (diff) | |
download | vdebug-d1b185b4bb1bf7fe3649fd679e7800e84b527842.zip |
Making the window height/width and status bar configurable
Diffstat (limited to 'python3')
-rw-r--r-- | python3/vdebug/ui/vimui.py | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/python3/vdebug/ui/vimui.py b/python3/vdebug/ui/vimui.py index 3463705..1d1f210 100644 --- a/python3/vdebug/ui/vimui.py +++ b/python3/vdebug/ui/vimui.py @@ -142,6 +142,13 @@ class Ui(interface.Ui): statuswin = self.windows.status() statuswin.set_status("loading") + window_sizes = opts.Options.get('window_size', dict) + for window_name, settings in window_sizes.items(): + if 'height' in settings: + self.windows.window(window_name).set_height(settings['height']) + if 'width' in settings: + self.windows.window(window_name).set_width(settings['width']) + log.Log.set_logger(log.WindowLogger( opts.Options.get('debug_window_level'), self.windows.log())) @@ -450,6 +457,12 @@ class Window(interface.Window): height = 1 self.command('resize %i' % height) + def set_width(self, width): + width = int(width) + if width <= 0: + width =1 + self.command('vertical resize %i' % width) + def write(self, msg, return_focus=True, after="normal G"): self._buffer.write(msg, return_focus, lambda: self.command(after)) @@ -634,7 +647,24 @@ class StatusWindow(Window): self.set_height(6) def set_status(self, status): - self.insert("Status: %s" % str(status), 0, True) + if opts.Options.get("simplified_status", int): + if str(status) == "stopped": + status = "■" + if str(status) == "running": + status = "▶" + if str(status) == "break": + status = "▌▌" + + keys = util.Keymapper() + + output = " " + str(status) + " " + output += "[%s Start] " % (keys.run_key()) + output += "[%s Stop] " % (keys.close_key()) + output += "[:help Vdebug]" + + self.insert(output, 0, True) + else: + self.insert("Status: %s" % str(status), 0, True) def mark_as_stopped(self): self.set_status("stopped") |