Allow 0 in line ranges in vim mode.
ClosedPublic

Authored by verner on Aug 17 2019, 7:39 PM.

Details

Summary

Vim numbers lines starting from 1. However, in command ranges such as, e.g., 0,$s/foo/bar/g
it accepts zero as a line number and treats it as 1. This commit implements the same behaviour
for kate.

Diff Detail

Repository
R39 KTextEditor
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
verner created this revision.Aug 17 2019, 7:39 PM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptAug 17 2019, 7:39 PM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
verner requested review of this revision.Aug 17 2019, 7:39 PM
This revision is now accepted and ready to land.Aug 17 2019, 7:55 PM
This revision was automatically updated to reflect the committed changes.
dfaure added a subscriber: dfaure.Aug 17 2019, 8:14 PM

The unittest doesn't seem to pass on CI:
https://build.kde.org/job/Frameworks/job/ktexteditor/job/kf5-qt5%20SUSEQt5.12/149/testReport/junit/projectroot.autotests.src/vimode/vimode_emulatedcommandbar/

FAIL!  :   EmulatedCommandBarTest::EmulatedCommandBarTests() Compared values are not the same
Actual   (kate_document->text()): "bar\nbar\nbar"
Expected (expected_text)        : "foo\nfoo\nbar"
Loc: [/home/jenkins/workspace/Frameworks/ktexteditor/kf5-qt5 SUSEQt5.12/autotests/src/vimode/emulatedcommandbar.cpp(1950)]
cullmann reopened this revision.Aug 17 2019, 9:56 PM
This revision is now accepted and ready to land.Aug 17 2019, 9:56 PM

Jonathan, could you take a look? Thanks.

This revision was automatically updated to reflect the committed changes.