From 9c471287998ec4ea3f1665dfaec1c56b1a0edfc3 Mon Sep 17 00:00:00 2001 From: George Edward Bulmer Date: Tue, 6 Feb 2018 18:25:15 +0000 Subject: [PATCH] Use provided methods instead of protected members --- qutebrowser/browser/browsertab.py | 2 +- qutebrowser/browser/commands.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/qutebrowser/browser/browsertab.py b/qutebrowser/browser/browsertab.py index 1a514f4a3..02048473d 100644 --- a/qutebrowser/browser/browsertab.py +++ b/qutebrowser/browser/browsertab.py @@ -806,7 +806,7 @@ class AbstractTab(QWidget): raise NotImplementedError def dump_async(self, callback, *, plain=False): - """Dump the current page to a file ascync. + """Dump the current page's html asynchronously. The given callback will be called with the result when dumping is complete. diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 1c08cede6..3063c8cda 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -1515,10 +1515,10 @@ class CommandDispatcher: return if current_url.scheme() == 'view-source': raise cmdexc.CommandError("Already viewing source!") + if edit: ed = editor.ExternalEditor(self._tabbed_browser) - - tab._widget.page().toHtml(ed.edit) + tab.dump_async(ed.edit) else: tab.action.show_source()