From 8f70227ae78ea478d8e382b2fc8dd1c0ec29accc Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Sun, 22 Oct 2017 22:36:53 +0200 Subject: ktexteditor: fix broken auto-indentation for some languages (e.g. python) --- kde/build/ktexteditor | 1 + kde/patch/ktexteditor.patch | 3 ++ .../ktexteditor/ktexteditor_fix_indentation.patch | 32 ++++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 kde/build/ktexteditor create mode 100644 kde/patch/ktexteditor.patch create mode 100644 kde/patch/ktexteditor/ktexteditor_fix_indentation.patch diff --git a/kde/build/ktexteditor b/kde/build/ktexteditor new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/kde/build/ktexteditor @@ -0,0 +1 @@ +2 diff --git a/kde/patch/ktexteditor.patch b/kde/patch/ktexteditor.patch new file mode 100644 index 0000000..30f1207 --- /dev/null +++ b/kde/patch/ktexteditor.patch @@ -0,0 +1,3 @@ +# Fix indentation for some languages (e.g. Python) in Kate and KDevelop: +cat $CWD/patch/ktexteditor/ktexteditor_fix_indentation.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } + diff --git a/kde/patch/ktexteditor/ktexteditor_fix_indentation.patch b/kde/patch/ktexteditor/ktexteditor_fix_indentation.patch new file mode 100644 index 0000000..fc5d9d9 --- /dev/null +++ b/kde/patch/ktexteditor/ktexteditor_fix_indentation.patch @@ -0,0 +1,32 @@ +From aeebeadb5f5955995c17de56cf83ba7166a132dd Mon Sep 17 00:00:00 2001 +From: Sven Brauch +Date: Mon, 16 Oct 2017 18:35:50 +0200 +Subject: fix some indenters from indenting on random characters + +If triggerCharacters was not set, toString() would return "undefined", +making indenters trigger on u, n, d, e, f, i and n. + +Differential Revision: https://phabricator.kde.org/D8333 +--- + src/script/kateindentscript.cpp | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/script/kateindentscript.cpp b/src/script/kateindentscript.cpp +index 15ce387..380bd45 100644 +--- a/src/script/kateindentscript.cpp ++++ b/src/script/kateindentscript.cpp +@@ -46,7 +46,10 @@ const QString &KateIndentScript::triggerCharacters() + + m_triggerCharactersSet = true; + +- m_triggerCharacters = global(QStringLiteral("triggerCharacters")).toString(); ++ auto triggerCharacters = global(QStringLiteral("triggerCharacters")); ++ if ( !triggerCharacters.isUndefined() ) { ++ m_triggerCharacters = triggerCharacters.toString(); ++ } + + //qCDebug(LOG_KTE) << "trigger chars: '" << m_triggerCharacters << "'"; + +-- +cgit v0.11.2 + -- cgit v1.2.3