Show More
@@ -70,6 +70,19 b' class AutoreleasePoolWrappedThreadedEngineService(ThreadedEngineService):' | |||||
70 |
|
70 | |||
71 |
|
71 | |||
72 |
|
72 | |||
|
73 | class Cell(NSObject): | |||
|
74 | """ | |||
|
75 | Representation of the prompts, input and output of a cell in the | |||
|
76 | frontend | |||
|
77 | """ | |||
|
78 | ||||
|
79 | blockNumber = objc.ivar().unsigned_long() | |||
|
80 | blockID = objc.ivar() | |||
|
81 | inputBlock = objc.ivar() | |||
|
82 | output = objc.ivar() | |||
|
83 | ||||
|
84 | ||||
|
85 | ||||
73 | class CellBlock(object): |
|
86 | class CellBlock(object): | |
74 | """ |
|
87 | """ | |
75 | Storage for information about text ranges relating to a single cell |
|
88 | Storage for information about text ranges relating to a single cell | |
@@ -353,9 +366,9 b' class IPythonCocoaController(NSObject, AsyncFrontEndBase):' | |||||
353 | def new_cell_block(self): |
|
366 | def new_cell_block(self): | |
354 | """A new CellBlock at the end of self.textView.textStorage()""" |
|
367 | """A new CellBlock at the end of self.textView.textStorage()""" | |
355 |
|
368 | |||
356 |
return CellBlock(NSMakeRange(self.textView.textStorage().length() |
|
369 | return CellBlock(NSMakeRange(self.textView.textStorage().length(), | |
357 | 0), #len(self.input_prompt())), |
|
370 | 0), #len(self.input_prompt())), | |
358 |
NSMakeRange(self.textView.textStorage().length() |
|
371 | NSMakeRange(self.textView.textStorage().length(),# + len(self.input_prompt()), | |
359 | 0)) |
|
372 | 0)) | |
360 |
|
373 | |||
361 |
|
374 | |||
@@ -389,7 +402,6 b' class IPythonCocoaController(NSObject, AsyncFrontEndBase):' | |||||
389 | textRange = NSMakeRange(self.textView.textStorage().length(), 0) |
|
402 | textRange = NSMakeRange(self.textView.textStorage().length(), 0) | |
390 |
|
403 | |||
391 |
|
404 | |||
392 | print textRange,string,self.textView.textStorage(),self.textView.textStorage().length() |
|
|||
393 | self.textView.replaceCharactersInRange_withString_( |
|
405 | self.textView.replaceCharactersInRange_withString_( | |
394 | textRange, string) |
|
406 | textRange, string) | |
395 |
|
407 | |||
@@ -528,7 +540,7 b' class IPythonCocoaController(NSObject, AsyncFrontEndBase):' | |||||
528 | r = r.rangeValue() |
|
540 | r = r.rangeValue() | |
529 | if(textView.textStorage().length() > 0 and |
|
541 | if(textView.textStorage().length() > 0 and | |
530 | r.location < self.current_block_range().inputRange.location): |
|
542 | r.location < self.current_block_range().inputRange.location): | |
531 |
self.insert_text(s |
|
543 | self.insert_text(s) | |
532 | allow = False |
|
544 | allow = False | |
533 |
|
545 | |||
534 | return allow |
|
546 | return allow |
General Comments 0
You need to be logged in to leave comments.
Login now