corrected undo/redo line change detection problem with modified line

problem occurred if there was a modified line when there was an undo or
redo operation that was in another part of the program, the modified
line was not being reported as changed (because the document change
signal occurs before the cursor moved signal)

added a check before processing the document change if there is a
modified line not at the change line, then the capture modified line
routine is called to report the modified line; however, if the modified
line is after the change, then text line obtained from the document
needs to be offset by the net line count change of the change (but the
line reported as changed still needs to be the original line since the
change being processed hasn't been reported yet, but the document has
already been changed)

also renamed the modified line variables to make the code easier to read