Commit 535af159 authored by Miquel Sabaté's avatar Miquel Sabaté

vimode: fixed a crash when performing the command "cn" in normal mode.

parent b9480bba
......@@ -301,7 +301,7 @@ KateViRange KateViModeBase::findPatternForMotion( const QString& pattern, bool b
kDebug( 13070 ) << "searching for pattern \"" << pattern << "\", backwards = " << backwards
<< ", caseSensitive = " << caseSensitive << ", count = " << count;
if ( pattern.isEmpty() ) {
return KateViRange();
return KateViRange::invalid();
}
Range match = findPattern(pattern, backwards, caseSensitive, startFrom, count);
......
......@@ -2530,6 +2530,9 @@ KateViRange KateViNormalMode::motionFindPrev()
KateViRange match = findPatternForMotion( pattern, !backwards, caseSensitive, m_view->cursorPosition(), getCount() );
if (!match.valid) {
return match;
}
if (!placeCursorAtEndOfMatch)
{
return KateViRange(match.startLine, match.startColumn, ViMotion::ExclusiveMotion);
......@@ -2549,6 +2552,9 @@ KateViRange KateViNormalMode::motionFindNext()
KateViRange match = findPatternForMotion( pattern, backwards, caseSensitive, m_view->cursorPosition(), getCount() );
if (!match.valid) {
return match;
}
if (!placeCursorAtEndOfMatch)
{
return KateViRange(match.startLine, match.startColumn, ViMotion::ExclusiveMotion);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment