From fd6e56e0843f6d8f77cccf32caf901544488add0 2008-07-03 19:18:54 From: Barry Wark Date: 2008-07-03 19:18:54 Subject: [PATCH] branch to try non-textview --- diff --git a/IPython/frontend/cocoa/cocoa_frontend.py b/IPython/frontend/cocoa/cocoa_frontend.py index ce11c2b..801e85d 100644 --- a/IPython/frontend/cocoa/cocoa_frontend.py +++ b/IPython/frontend/cocoa/cocoa_frontend.py @@ -70,6 +70,19 @@ class AutoreleasePoolWrappedThreadedEngineService(ThreadedEngineService): +class Cell(NSObject): + """ + Representation of the prompts, input and output of a cell in the + frontend + """ + + blockNumber = objc.ivar().unsigned_long() + blockID = objc.ivar() + inputBlock = objc.ivar() + output = objc.ivar() + + + class CellBlock(object): """ Storage for information about text ranges relating to a single cell @@ -353,9 +366,9 @@ class IPythonCocoaController(NSObject, AsyncFrontEndBase): def new_cell_block(self): """A new CellBlock at the end of self.textView.textStorage()""" - return CellBlock(NSMakeRange(self.textView.textStorage().length()-1, + return CellBlock(NSMakeRange(self.textView.textStorage().length(), 0), #len(self.input_prompt())), - NSMakeRange(self.textView.textStorage().length()-1,# + len(self.input_prompt()), + NSMakeRange(self.textView.textStorage().length(),# + len(self.input_prompt()), 0)) @@ -389,7 +402,6 @@ class IPythonCocoaController(NSObject, AsyncFrontEndBase): textRange = NSMakeRange(self.textView.textStorage().length(), 0) - print textRange,string,self.textView.textStorage(),self.textView.textStorage().length() self.textView.replaceCharactersInRange_withString_( textRange, string) @@ -528,7 +540,7 @@ class IPythonCocoaController(NSObject, AsyncFrontEndBase): r = r.rangeValue() if(textView.textStorage().length() > 0 and r.location < self.current_block_range().inputRange.location): - self.insert_text(s, textRange=r) + self.insert_text(s) allow = False return allow