Show More
@@ -29,13 +29,18 b' class ZMQCompleter(IPCompleter):' | |||||
29 | self.shell = shell |
|
29 | self.shell = shell | |
30 | self.client = client |
|
30 | self.client = client | |
31 | self.matches = [] |
|
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 | def complete_request(self, text): |
|
38 | def complete_request(self, text): | |
34 | line = readline.get_line_buffer() |
|
39 | line = readline.get_line_buffer() | |
35 | cursor_pos = readline.get_endidx() |
|
40 | cursor_pos = readline.get_endidx() | |
36 |
|
41 | |||
37 | # send completion request to kernel |
|
42 | # send completion request to kernel | |
38 |
# Give the kernel up to |
|
43 | # Give the kernel up to 5s to respond | |
39 | msg_id = self.client.complete( |
|
44 | msg_id = self.client.complete( | |
40 | code=line, |
|
45 | code=line, | |
41 | cursor_pos=cursor_pos, |
|
46 | cursor_pos=cursor_pos, | |
@@ -43,7 +48,8 b' class ZMQCompleter(IPCompleter):' | |||||
43 |
|
48 | |||
44 | msg = self.client.shell_channel.get_msg(timeout=self.timeout) |
|
49 | msg = self.client.shell_channel.get_msg(timeout=self.timeout) | |
45 | if msg['parent_header']['msg_id'] == msg_id: |
|
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 | return [] |
|
53 | return [] | |
48 |
|
54 | |||
49 | def rlcomplete(self, text, state): |
|
55 | def rlcomplete(self, text, state): |
General Comments 0
You need to be logged in to leave comments.
Login now