fix some indenters from randomly invoking indent
ClosedPublic

Authored by brauch on Oct 16 2017, 4:37 PM.

Details

Summary

If triggerCharacters was not set, toString() would return "undefined",
making indenters trigger on u, n, d, e, f, i and n.

Test Plan

Trigger chars are still set correctly for e.g. cmake.

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.
brauch created this revision.Oct 16 2017, 4:37 PM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptOct 16 2017, 4:37 PM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
anthonyfieroni added inline comments.
src/script/kateindentscript.cpp
47

But if triggerCharacters are undefined this variable should be false, no?

brauch marked an inline comment as done.Oct 16 2017, 6:09 PM
brauch added inline comments.
src/script/kateindentscript.cpp
47

No, that's still fine, this variable just caches reading the value from the script object. If the script doesn't define it, it is read as empty, and then doesn't look again (because that won't change in the future).

dhaumann accepted this revision.Oct 16 2017, 6:48 PM

That makes a lot of sense. Please commit. Does that fix the indentation problems reported about Python?

This revision is now accepted and ready to land.Oct 16 2017, 6:48 PM
brauch marked 2 inline comments as done.Oct 16 2017, 7:33 PM

Yes, at least the ones I'm aware of. Thanks for the review, I'll push it in a moment.

This revision was automatically updated to reflect the committed changes.
cullmann reopened this revision.Oct 16 2017, 7:58 PM

Thanks for the fix!
Just one thing: could we in addition have an addition indentation test that uses the trigger chars? Its amazing we seem to have none for this as otherwise this problem would have been fixed during the port.

This revision is now accepted and ready to land.Oct 16 2017, 7:58 PM
mwolff closed this revision.Nov 19 2017, 10:19 PM