This completes the scripting API for QJSValue-based Cursor and Range functions. The changes are rather simple, sometimes code is just moved around to make the header file more readable.
Details
make test succeeds.
Diff Detail
- Repository
- R39 KTextEditor
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Question: Do we need the overloads with the KTextEditor::Cursor at all or should we limit that to line/column + QJSValue?
A few of the cursor/range functions are used, but not all of them. You could probably rewrite the places using them to use line+col instead.
Yes, Allen is correct: Essentially, we could remove all helper functions that use KTE::Range/Cursor. Shall I update the patch?
Think that would be nice.
Then we always have only that tuple of functions, makes it less confusing (and less to maintain).
Remove KTextEditor::Cursor and KTextEditor::Range based API. make test still succeeds.
Looks ok for me.
To shorten the code, I would have used
const auto cursor = cursorFromScriptValue(jscursor);
at most places, but that is taste, the explicit type makes more clear what the type is ;=)