Show More
@@ -29,13 +29,18 b' class ZMQCompleter(IPCompleter):' | |||
|
29 | 29 | self.shell = shell |
|
30 | 30 | self.client = client |
|
31 | 31 | self.matches = [] |
|
32 | ||
|
32 | # don't do any splitting client-side, | |
|
33 | # rely on the kernel for that | |
|
34 | self.splitter.delims = '\r\n' | |
|
35 | if self.readline: | |
|
36 | self.readline.set_completer_delims('\r\n') | |
|
37 | ||
|
33 | 38 | def complete_request(self, text): |
|
34 | 39 | line = readline.get_line_buffer() |
|
35 | 40 | cursor_pos = readline.get_endidx() |
|
36 | 41 | |
|
37 | 42 | # send completion request to kernel |
|
38 |
# Give the kernel up to |
|
|
43 | # Give the kernel up to 5s to respond | |
|
39 | 44 | msg_id = self.client.complete( |
|
40 | 45 | code=line, |
|
41 | 46 | cursor_pos=cursor_pos, |
@@ -43,7 +48,8 b' class ZMQCompleter(IPCompleter):' | |||
|
43 | 48 | |
|
44 | 49 | msg = self.client.shell_channel.get_msg(timeout=self.timeout) |
|
45 | 50 | if msg['parent_header']['msg_id'] == msg_id: |
|
46 |
|
|
|
51 | cursor_start = msg['content']['cursor_start'] | |
|
52 | return [ line[:cursor_start] + m for m in msg['content']['matches'] ] | |
|
47 | 53 | return [] |
|
48 | 54 | |
|
49 | 55 | def rlcomplete(self, text, state): |
General Comments 0
You need to be logged in to leave comments.
Login now