Version: 4.0.0 (using KDE 4.5.1) OS: Linux When the tabwidth is set to any value < 4, lines with > 1 level of indentation are shown with only 1 level of indentation. Therefore only lines with 0 or 1 level of indentation are shown correctly. It seems to work with tab widths >= 4. Reproducible: Always Steps to Reproduce: 1. Start Konsole. 2. Create a directory and cd into it. 3. Create the empty file empty.cc 4. Create the file prov.cc with some content like this: float calculate_something(float const a, float const b, float const c) { return calculate_something(1.7, calculate_something(8.9, 19.51, 33.0), a) + calculate_something(c, 18.8, calculate_something(7.5, b, a)); } 5. Execute "diff -u empty.cc prov.cc|kompare -". 6. Open the settings dialog and change the tab width to 3. 7. Press Ok. Actual Results: float calculate_something(float const a, float const b, float const c) { return calculate_something(1.7, calculate_something(8.9, 19.51, 33.0), a) + calculate_something(c, 18.8, calculate_something(7.5, b, a)); } Expected Results: float calculate_something(float const a, float const b, float const c) { return calculate_something(1.7, calculate_something(8.9, 19.51, 33.0), a) + calculate_something(c, 18.8, calculate_something(7.5, b, a)); } This problem is new in KDE4.
Ping
Hmmm, the KompareListViewLineItem::expandTabs routine uses the following formula: QString(tabstop-((startPos+index)%4),' ') which looks very wrong to me. The hardcoded "4" does not make any sense whatsoever. The regression was introduced by this commit: http://websvn.kde.org/?view=revision&revision=1026032 by je4d.
The correct formula is: QString(tabstop-((startPos+index)%tabstop),' ')
SVN commit 1278831 by kkofler: Kompare: Fix nonsensical tab expansion formula introduced by commit 1026032. FIXED-IN: 4.8.1 M +1 -1 komparelistview.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1278831
SVN commit 1278833 by kkofler: Kompare: Fix nonsensical tab expansion formula introduced by commit 1026032. Backport revision 1278831 from trunk. M +1 -1 komparelistview.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1278833
Thank you!