Issue57

Title Bug - Leap to last character causes problem with run length encoding
Priority critical Status resolved
Superseder Bug - Inital and Final Character Slowdown
View: 71
Nosy List Andrew, Atul, Han
Assigned To Andrew Topics Bug

Created on 2005-02-09.18:05:14 by Han, last changed 2005-02-12.22:31:09 by admin.

Messages
msg97 (view) Author: Andrew Date: 2005-02-10.23:19:43
The problem was this: in the __init__ of the text classes, we always add one
character, because we had some goofy stuff going on.  So every time Archy
loaded, it was adding one character to the Text and Style arrays, meaning that
the end of the text was confused.
Removing this character made all the Style arrays much to small, which led to...
a couple small errors in RLE, which got resolved, which then broke...
loading AGAIN, but this time because of behaviors, because there was an addText
command which was trying to check an empty behavior array (which previously
would not have been empty, since it got initialized to that one-character).

But once that was fixed, everything was fine.
msg88 (view) Author: Aza Date: 2005-02-10.00:13:01
I believe that these are two side-effects of this parent bug:

(1) Now that there is a final document character that is locked alongside "E N D
  O F   D E L E T I O N S", which is also locked, typing anywhere in that chunk
of locked text causes a "IndexError: list index out of range" error (as per
msg84). This is because typing in locked text requires scanning for the
beginning and ending of that text. The scan to the end causes the crash via the
run length encoding error.

(2) Attempting to repeatedly creep right from the final document character (try
10 creeps in a row) permanently slows all of Archy down until Archy is
restarted. CPU usage during any cursor movement goes from sipping 5-7% before
the slowdown to 100% after the slowdown. I am assuming this is related to the
run length encoding bug.
msg85 (view) Author: Han Date: 2005-02-09.18:06:37
The previous traceback occurs when Leaping to the last document character.

There was another issue with this problem listed here that was assigned to 
Andrew. I will check this and fix it.
msg84 (view) Author: Han Date: 2005-02-09.18:05:14
Traceback (most recent call last):
  File "pygame_run.py", line 203, in ?
    main()
  File "pygame_run.py", line 189, in main
    handle_event(e)
  File "pygame_run.py", line 105, in handle_event
    key.keyPress(e.key, keyChar, 'down')
  File "C:\Documents and Settings\Han\Desktop\reducks\key.py", line 781, in keyP
ress
    globalState.keypress(keycode, unicode, downOrUp)
  File "C:\Documents and Settings\Han\Desktop\reducks\key.py", line 743, in keyp
ress
    self.quasimode.keypress(keycode, unicode, downOrUp)
  File "C:\Documents and Settings\Han\Desktop\reducks\key.py", line 496, in keyp
ress
    self.leapCommand.addChar(char)
  File "C:\Documents and Settings\Han\Desktop\reducks\commands\cursor.py", line
257, in addChar
    self._updateSelections(firstOccurance)
  File "C:\Documents and Settings\Han\Desktop\reducks\commands\cursor.py", line
187, in _updateSelections
    text_layers.mainText.setCursor(newCursorPos)
  File "C:\Documents and Settings\Han\Desktop\reducks\text_abstract.py", line 22
3, in setCursor
    o.onCursorChange()
  File "C:\Documents and Settings\Han\Desktop\reducks\commands\cursor.py", line
377, in onCursorChange
    focusBehaviors = filter(lambda com:com <> None, mT.behaviorArray.getFocusBeh
avior(pos))
  File "C:\Documents and Settings\Han\Desktop\reducks\behavior_array.py", line 1
28, in getFocusBehavior
    behaviorID = self._array[pos]
  File "C:\Documents and Settings\Han\Desktop\reducks\run_length_list.py", line
161, in __getitem__
    return self._rle[pos][0]
IndexError: list index out of range

C:\Documents and Settings\Han\Desktop\reducks>
History
Date User Action Args
2005-02-12 22:31:09adminsetnosy: + Atul
superseder: + Bug - Inital and Final Character Slowdown
2005-02-12 22:30:50adminunlinkissue71 superseder
2005-02-12 22:30:24adminlinkissue71 superseder
2005-02-10 23:19:43Andrewsetstatus: in-progress -> resolved
messages: + msg97
2005-02-10 03:43:27Hansetassignedto: Han -> Andrew
nosy: + Andrew
2005-02-10 00:14:37Azasetmessages: - msg89
2005-02-10 00:14:29Azasetmessages: + msg89
2005-02-10 00:13:01Azasetmessages: + msg88
2005-02-09 18:22:45Hanlinkissue12 superseder
2005-02-09 18:10:37Hansettopic: + Bug
title: Leap to last character causes problem with run length encoding -> Bug - Leap to last character causes problem with run length encoding
2005-02-09 18:06:37Hansetmessages: + msg85
2005-02-09 18:05:21Hansetpriority: short-term -> critical
2005-02-09 18:05:14Hancreate