Show More
@@ -700,10 +700,20 class FrontendWidget(HistoryConsoleWidget, BaseFrontendMixin): | |||||
700 | #--------------------------------------------------------------------------- |
|
700 | #--------------------------------------------------------------------------- | |
701 | # 'FrontendWidget' protected interface |
|
701 | # 'FrontendWidget' protected interface | |
702 | #--------------------------------------------------------------------------- |
|
702 | #--------------------------------------------------------------------------- | |
703 |
|
703 | |||
704 | def _call_tip(self): |
|
704 | def _auto_call_tip(self): | |
705 | """ Shows a call tip, if appropriate, at the current cursor location. |
|
705 | """Trigger call tip automatically on open parenthesis | |
|
706 | ||||
|
707 | Call tips can be requested explcitly with `_call_tip`. | |||
706 | """ |
|
708 | """ | |
|
709 | cursor = self._get_cursor() | |||
|
710 | cursor.movePosition(QtGui.QTextCursor.Left) | |||
|
711 | if cursor.document().characterAt(cursor.position()) == '(': | |||
|
712 | # trigger auto call tip on open paren | |||
|
713 | self._call_tip() | |||
|
714 | ||||
|
715 | def _call_tip(self): | |||
|
716 | """Shows a call tip, if appropriate, at the current cursor location.""" | |||
707 | # Decide if it makes sense to show a call tip |
|
717 | # Decide if it makes sense to show a call tip | |
708 | if not self.enable_calltips or not self.kernel_client.shell_channel.is_alive(): |
|
718 | if not self.enable_calltips or not self.kernel_client.shell_channel.is_alive(): | |
709 | return False |
|
719 | return False | |
@@ -785,7 +795,7 class FrontendWidget(HistoryConsoleWidget, BaseFrontendMixin): | |||||
785 |
|
795 | |||
786 | document = self._control.document() |
|
796 | document = self._control.document() | |
787 | if position == self._get_cursor().position(): |
|
797 | if position == self._get_cursor().position(): | |
788 | self._call_tip() |
|
798 | self._auto_call_tip() | |
789 |
|
799 | |||
790 | #------ Trait default initializers ----------------------------------------- |
|
800 | #------ Trait default initializers ----------------------------------------- | |
791 |
|
801 |
General Comments 0
You need to be logged in to leave comments.
Login now