Fix completion stuff
This commit is contained in:
parent
8c1b5f0581
commit
c8c9536beb
@ -704,7 +704,7 @@ class AbstractTab(QWidget):
|
||||
|
||||
def _handle_auto_insert_mode(self, ok):
|
||||
"""Handle auto-insert-mode after loading finished."""
|
||||
if not config.val.input.auto_insert_mode or not ok:
|
||||
if not config.val.input.insert_mode.auto_focused or not ok:
|
||||
return
|
||||
|
||||
cur_mode = self._mode_manager.mode
|
||||
|
@ -157,7 +157,7 @@ class MouseEventFilter(QObject):
|
||||
'click', only_if_normal=True)
|
||||
else:
|
||||
log.mouse.debug("Clicked non-editable element!")
|
||||
if config.val.input.auto_leave_insert_mode:
|
||||
if config.val.input.insert_mode.auto_leave:
|
||||
modeman.leave(self._tab.win_id, usertypes.KeyMode.insert,
|
||||
'click', maybe=True)
|
||||
|
||||
@ -179,7 +179,7 @@ class MouseEventFilter(QObject):
|
||||
'click-delayed', only_if_normal=True)
|
||||
else:
|
||||
log.mouse.debug("Clicked non-editable element (delayed)!")
|
||||
if config.val.input.auto_leave_insert_mode:
|
||||
if config.val.input.insert_mode.auto_leave:
|
||||
modeman.leave(self._tab.win_id, usertypes.KeyMode.insert,
|
||||
'click-delayed', maybe=True)
|
||||
|
||||
|
@ -182,7 +182,7 @@ class AbstractWebElement(collections.abc.MutableMapping):
|
||||
# at least a classid attribute. Oh, and let's hope images/...
|
||||
# DON'T have a classid attribute. HTML sucks.
|
||||
log.webelem.debug("<object type='{}'> clicked.".format(objtype))
|
||||
return config.val.input.insert_mode_on_plugins
|
||||
return config.val.input.insert_mode.plugins
|
||||
else:
|
||||
# Image/Audio/...
|
||||
return False
|
||||
@ -247,7 +247,7 @@ class AbstractWebElement(collections.abc.MutableMapping):
|
||||
return self.is_writable()
|
||||
elif tag in ['embed', 'applet']:
|
||||
# Flash/Java/...
|
||||
return config.val.input.insert_mode_on_plugins and not strict
|
||||
return config.val.input.insert_mode.plugins and not strict
|
||||
elif tag == 'object':
|
||||
return self._is_editable_object() and not strict
|
||||
elif tag in ['div', 'pre']:
|
||||
|
@ -194,7 +194,7 @@ class Completer(QObject):
|
||||
if maxsplit is None:
|
||||
text = self._quote(text)
|
||||
model = self._model()
|
||||
if model.count() == 1 and config.val.completion.quick_complete:
|
||||
if model.count() == 1 and config.val.completion.quick:
|
||||
# If we only have one item, we want to apply it immediately
|
||||
# and go on to the next part.
|
||||
self._change_completed_part(text, before, after, immediate=True)
|
||||
|
@ -149,11 +149,11 @@ class CompletionItemDelegate(QStyledItemDelegate):
|
||||
self._painter.save()
|
||||
|
||||
if self._opt.state & QStyle.State_Selected:
|
||||
color = config.val.completion.item.selected.fg
|
||||
color = config.val.colors.completion.item.selected.fg
|
||||
elif not self._opt.state & QStyle.State_Enabled:
|
||||
color = config.val.completion.category.fg
|
||||
color = config.val.colors.completion.category.fg
|
||||
else:
|
||||
color = config.val.completion.fg
|
||||
color = config.val.colors.completion.fg
|
||||
self._painter.setPen(color)
|
||||
|
||||
ctx = QAbstractTextDocumentLayout.PaintContext()
|
||||
|
@ -257,7 +257,7 @@ class CompletionView(QTreeView):
|
||||
count = self.model().count()
|
||||
if count == 0:
|
||||
self.hide()
|
||||
elif count == 1 and config.val.completion.quick_complete:
|
||||
elif count == 1 and config.val.completion.quick:
|
||||
self.hide()
|
||||
elif config.val.completion.show == 'auto':
|
||||
self.show()
|
||||
|
Loading…
Reference in New Issue
Block a user