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 >