To continue this monolog…

I’m changing TextFlowEdit.removeEmptyParentChain() to remove empty paragraph 
terminators as part of the process. I added a function to ParagraphElement to 
remove empty terminators. If the terminator is not specifically removed, the 
terminator will always automatically be re-added (more aggressively than it 
used to).

I hope this doesn’t cause issues for client code (it does not seem to cause 
issues for my client code), but the existing behavior has been highly 
unpredictable.

If anyone sees problems with my approach, please speak up now!

On Oct 5, 2014, at 11:16 AM, Harbs <harbs.li...@gmail.com> wrote:

> Some more research shows that the non-replacement is normal. The paragraph is 
> then supposed to be merged, but that failed because there was a terminator 
> span. The terminator span got generated due to a change I made in 
> ensureTerminatorAfterReplace(). Of course, reverting my change causes a 
> runtime error in splitting paragraphs… :-(
> 
> I’ve taken to handling terminator spans as special cases when necessary. I 
> might do that here as well…
> 
> On Oct 5, 2014, at 10:52 AM, Harbs <harbs.li...@gmail.com> wrote:
> 
>>> I think the terminator is regenerating itself.
>> 
>> That’s not precise. The problem is actually in SpanElement.replaceText() 
>> where the relativeEndPosition is reduced for terminators so nothing is 
>> actually deleted…
>> 
>> A tiny bit of commenting in the code how terminators are supposed to work 
>> would have made my life a whole lot easier… :-(
>> 
>> On Oct 5, 2014, at 10:45 AM, Harbs <harbs.li...@gmail.com> wrote:
>> 
>>> The handling of paragraph terminators in TLF is proving to be a huge PITA… 
>>> I can’t tell you how many hours I have spent tracking down odd issues 
>>> related to tracking terminators. The whole concept that paragraph 
>>> terminators are not “real” content is convoluted to start with. Couldn’t 
>>> this have been designed a bit better?
>>> 
>>> Currently I have the following problem.
>>> 
>>> When a paragraph terminator is deleted, I’m having an issue where nothing 
>>> happens. I tracked the problem down to TextFlowEdit.deleteRangeInternal(). 
>>> I think the terminator is regenerating itself. The thing is, I’m not sure 
>>> what I changed about the code that’s making this happen.
>>> 
>>> Does anyone have a clue what’s supposed to happen when deleting a paragraph 
>>> terminator? How is the merge with the next paragraph supposed to happen?
>>> 
>>> Harbs
>> 
> 

Reply via email to