Version: (using KDE KDE 3.4.1) Installed from: SuSE RPMs OS: Linux Hi there, to reproduce, consider some text like that one: foo Axx xxB bar foo xxx xxx bar foo xxx xxx bar foo Dxx xxC bar now with block selection switched on, select the rectangle starting from point A down to point C and replace x by y - everything works fine. now go back and select the same rectangle, but from point D up to point B: you will get the same selection, but this time replace won't work. The selection can be done either with mouse or keyboard - same effect: A to C or C to A works fine, D to B or B to D doesn't.
duplicate of bug #97140 ???
still present in KDE 3.5alpha on kubuntu hoary
SVN commit 467566 by cullmann: next block selection search&replace bug BUG: 109183 M +26 -4 katesearch.cpp --- branches/KDE/3.5/kdelibs/kate/part/katesearch.cpp #467565:467566 @@ -274,7 +274,17 @@ { if( s.flags.selected ) { - s.cursor = s.flags.backward ? s.selEnd : s.selBegin; + KateTextCursor start (s.selBegin); + KateTextCursor end (s.selEnd); + + // recalc for block sel, to have start with lowest col, end with highest + if (m_view->blockSelectionMode()) + { + start.setCol (QMIN(s.selBegin.col(), s.selEnd.col())); + end.setCol (QMAX(s.selBegin.col(), s.selEnd.col())); + } + + s.cursor = s.flags.backward ? end : start; } else { @@ -591,12 +601,24 @@ if ( found && s.flags.selected ) { - if ( !s.flags.backward && KateTextCursor( foundLine, foundCol ) >= s.selEnd - || s.flags.backward && KateTextCursor( foundLine, foundCol ) < s.selBegin ) + KateTextCursor start (s.selBegin); + KateTextCursor end (s.selEnd); + + // recalc for block sel, to have start with lowest col, end with highest + if (m_view->blockSelectionMode()) + { + start.setCol (QMIN(s.selBegin.col(), s.selEnd.col())); + end.setCol (QMAX(s.selBegin.col(), s.selEnd.col())); + } + + if ( !s.flags.backward && KateTextCursor( foundLine, foundCol ) >= end + || s.flags.backward && KateTextCursor( foundLine, foundCol ) < start ) + { found = false; + } else if (m_view->blockSelectionMode()) { - if ((int)foundCol < QMAX(s.selEnd.col(), s.selBegin.col()) && (int)foundCol >= QMIN(s.selEnd.col(), s.selBegin.col())) + if ((int)foundCol >= start.col() && (int)foundCol < end.col()) break; } }