##// END OF EJS Templates
Allow offset 0 in position_to_cursor...
Thomas Kluyver -
Show More
@@ -869,7 +869,7 b' def position_to_cursor(text:str, offset:int)->Tuple[int, int]:'
869
869
870 """
870 """
871
871
872 assert 0 < offset <= len(text) , "0 < %s <= %s" % (offset , len(text))
872 assert 0 <= offset <= len(text) , "0 <= %s <= %s" % (offset , len(text))
873
873
874 before = text[:offset]
874 before = text[:offset]
875 blines = before.split('\n') # ! splitnes trim trailing \n
875 blines = before.split('\n') # ! splitnes trim trailing \n
General Comments 0
You need to be logged in to leave comments. Login now