##// END OF EJS Templates
Try to elide long completion based on user input....
Try to elide long completion based on user input. If what the user has typed is already in the completion and the completion is really long, try to elide what the user has already typed from the displayed text of the completion. Keep the first 3 and last 3 of what is already present. This will behave weirdly if all the completion have a common prefix as I believe prompt toolkit will insert the common prefix (or do we?). I'll have to check how to consider the common prefix as being typed.

File last commit:

r20278:8f4dcac7
r25689:d5704fdc
Show More
gilsleep.ipynb
72 lines | 1.6 KiB | text/plain | TextLexer

Holding the GIL for too long could disrupt the heartbeat due to non-copying sends.

The following cell repeatedly calls a function that holds the GIL for five seconds.

The heartbeat will fail after a few iterations prior to fixing Issue #1260.

In [1]:
import sys
import time

from cython import inline

def gilsleep(t):
    """gil-holding sleep with cython.inline"""
    code = '\n'.join([
        'from posix cimport unistd',
        'unistd.sleep(t)',
    ])
    while True:
        inline(code, quiet=True, t=t)
        print time.time()
        sys.stdout.flush() # this is important

gilsleep(5)
In [ ]: