Merge branch 'master' of github.com:qutebrowser/qutebrowser into angular-hints

This commit is contained in:
Nemanja Nedeljkovic 2018-01-13 23:18:39 +01:00
commit 8d8566a5ab
10 changed files with 25 additions and 14 deletions

View File

@ -110,6 +110,7 @@ Changed
order, and mixed matches on URL/tite are possible.
- The system's default encoding (rather than UTF-8) is now used to decode
subprocess output.
- qutebrowser now ensures it's focused again after an external editor is closed.
Fixed
~~~~~
@ -134,6 +135,7 @@ Fixed
- Fix crash when a subprocess outputs data which is not decodable as UTF-8.
- Fix crash when closing a tab immediately after hinting.
- Worked around issues in Qt 5.10 with loading progress never being finished.
- Fixed a crash when writing a flag before a command (e.g. `:-w open `).
Deprecated
~~~~~~~~~~

View File

@ -2,7 +2,7 @@
certifi==2017.11.5
chardet==3.0.4
codecov==2.0.10
codecov==2.0.13
coverage==4.4.2
idna==2.6
requests==2.18.4

View File

@ -8,8 +8,8 @@ flake8-comprehensions==1.4.1
flake8-copyright==0.2.0
flake8-debugger==3.0.0
flake8-deprecated==1.3
flake8-docstrings==1.1.0
flake8-future-import==0.4.3
flake8-docstrings==1.3.0
flake8-future-import==0.4.4
flake8-mock==0.3
flake8-per-file-ignores==0.4
flake8-polyfill==1.0.2
@ -17,7 +17,7 @@ flake8-string-format==0.2.3
flake8-tidy-imports==1.1.0
flake8-tuple==0.2.13
mccabe==0.6.1
pep8-naming==0.4.1
pep8-naming==0.5.0
pycodestyle==2.3.1
pydocstyle==2.1.1
pyflakes==1.6.0

View File

@ -3,6 +3,6 @@
appdirs==1.4.3
packaging==16.8
pyparsing==2.2.0
setuptools==38.2.5
setuptools==38.4.0
six==1.11.0
wheel==0.30.0

View File

@ -11,7 +11,7 @@ fields==5.0.0
Flask==0.12.2
glob2==0.6
hunter==2.0.2
hypothesis==3.44.4
hypothesis==3.44.13
itsdangerous==0.24
# Jinja2==2.10
Mako==1.0.7
@ -28,7 +28,7 @@ pytest-cov==2.5.1
pytest-faulthandler==1.3.1
pytest-instafail==0.3.0
pytest-mock==1.6.3
pytest-qt==2.3.0
pytest-qt==2.3.1
pytest-repeat==0.4.1
pytest-rerunfailures==4.0
pytest-travis-fold==1.3.0

View File

@ -1644,6 +1644,8 @@ class CommandDispatcher:
except webelem.Error as e:
raise cmdexc.CommandError(str(e))
mainwindow.raise_window(objreg.last_focused_window(), alert=False)
@cmdutils.register(instance='command-dispatcher', maxsplit=0,
scope='window')
def insert_text(self, text):

View File

@ -32,7 +32,7 @@ from qutebrowser.misc import objects, sql
# increment to indicate that HistoryCompletion must be regenerated
_USER_VERSION = 1
_USER_VERSION = 2
class CompletionHistory(sql.SqlTable):
@ -102,7 +102,8 @@ class WebHistory(sql.SqlTable):
data = {'url': [], 'title': [], 'last_atime': []}
# select the latest entry for each url
q = sql.Query('SELECT url, title, max(atime) AS atime FROM History '
'WHERE NOT redirect GROUP BY url ORDER BY atime asc')
'WHERE NOT redirect and url NOT LIKE "qute://back%" '
'GROUP BY url ORDER BY atime asc')
for entry in q.run():
data['url'].append(self._format_completion_url(QUrl(entry.url)))
data['title'].append(entry.title)
@ -171,7 +172,9 @@ class WebHistory(sql.SqlTable):
@pyqtSlot(QUrl, QUrl, str)
def add_from_tab(self, url, requested_url, title):
"""Add a new history entry as slot, called from a BrowserTab."""
if url.scheme() == 'data' or requested_url.scheme() == 'data':
if any(url.scheme() == 'data' or
(url.scheme(), url.host()) == ('qute', 'back')
for url in (url, requested_url)):
return
if url.isEmpty():
# things set via setHtml

View File

@ -87,8 +87,6 @@ class Completer(QObject):
# cursor on a flag or after an explicit split (--)
return None
log.completion.debug("Before removing flags: {}".format(before_cursor))
before_cursor = [x for x in before_cursor if not x.startswith('-')]
log.completion.debug("After removing flags: {}".format(before_cursor))
if not before_cursor:
# '|' or 'set|'
log.completion.debug('Starting command completion')
@ -99,6 +97,9 @@ class Completer(QObject):
log.completion.debug("No completion for unknown command: {}"
.format(before_cursor[0]))
return None
before_cursor = [x for x in before_cursor if not x.startswith('-')]
log.completion.debug("After removing flags: {}".format(before_cursor))
argpos = len(before_cursor) - 1
try:
func = cmd.get_pos_arg_info(argpos).completion

View File

@ -94,13 +94,15 @@ def get_window(via_ipc, force_window=False, force_tab=False,
return window.win_id
def raise_window(window):
def raise_window(window, alert=True):
"""Raise the given MainWindow object."""
window.setWindowState(window.windowState() & ~Qt.WindowMinimized)
window.setWindowState(window.windowState() | Qt.WindowActive)
window.raise_()
window.activateWindow()
QApplication.instance().alert(window)
if alert:
QApplication.instance().alert(window)
# WORKAROUND for https://github.com/PyCQA/pylint/issues/1770

View File

@ -190,6 +190,7 @@ def _set_cmd_prompt(cmd, txt):
(':gibberish nonesense |', None, '', []),
('/:help|', None, '', []),
('::bind|', 'command', ':bind', []),
(':-w open |', None, '', []),
])
def test_update_completion(txt, kind, pattern, pos_args, status_command_stub,
completer_obj, completion_widget_stub, config_stub,