https://bugs.kde.org/show_bug.cgi?id=519432
Jaimukund Bhan <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #4 from Jaimukund Bhan <[email protected]> --- I was taking a look at this bug. I found out that the relevant code lives in src/common/diff.cpp. Currently, strings are divided into Words and Spaces, and the RegEx logic is such that the "<shortcut>" tag is added to the Words list as "shortcut" and the "</shortcut>" tag is added as a whole to Spaces list. There is also a Word+Space swallowing logic while creating the diff highlight, meaning that every word that is removed or added also swallows the corresponding space after it (Be it a whitespace, a +, or in this case the </shortcut> tag). I tried a few different things and wanted to ask is a tokenized approach would be better, where instead of splitting the string into Words and Spaces list, we make a Tokens list where elements are Words, Whitespaces, Symbols, Tags, etc. This will remove the need for the swallow logic which causes this problem, and also help highlight changes if a difference in whitespaces has been made. For Example, If I change "Meta+W" to "Mota+W", "Meta+" and "Mota+" is highlighted, where it would make sense if only "Meta" and "Mota" are highlighted. Please let me know if there are cases where this approach would not work, I will try looking for a better solution as well. -- You are receiving this mail because: You are watching all bug changes.
