[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kate] part/script/data/indentation: indent after incompleted "return"
From: Alex Turbov <i.zaufi () gmail ! com>
Date: 2014-02-24 17:05:21
Message-ID: E1WHyy1-0005zJ-0V () scm ! kde ! org
[Download RAW message or body]
Git commit 44f4339993d8e3d331fe8f65590f30fe8aa70eb7 by Alex Turbov.
Committed on 24/02/2014 at 17:05.
Pushed by turbov into branch 'master'.
indent after incompleted "return"
M +2 -3 part/script/data/indentation/cppstyle.js
http://commits.kde.org/kate/44f4339993d8e3d331fe8f65590f30fe8aa70eb7
diff --git a/part/script/data/indentation/cppstyle.js \
b/part/script/data/indentation/cppstyle.js index 08a6833..7140f32 100644
--- a/part/script/data/indentation/cppstyle.js
+++ b/part/script/data/indentation/cppstyle.js
@@ -59,7 +59,7 @@ require ("string.js");
// TBD <others>
triggerCharacters = "{}()[]<>/:;,#\\?!|&/%.@ '\"=*^";
-var debugMode = false;
+var debugMode = true;
/// \todo Move to a separate library?
function dbg()
@@ -659,7 +659,7 @@ function tryIndentAfterSomeKeywords_ch(line)
// Check if ENTER was pressed after some keywords...
var prevString = document.line(line - 1);
dbg("tryIndentAfterSomeKeywords_ch prevString='"+prevString+"'");
- var r = /^(\s*)((if|for|while)\s*\(|\bdo\b|(((public|protected|private)(\s+(slots|Q_SLOTS))?)|default|case\s+.*)\s*:).*$/
+ var r = /^(\s*)((if|for|while)\s*\(|\bdo\b|\breturn\b|(((public|protected|private)(\s+(slots|Q_SLOTS))?)|default|case\s+.*)\s*:).*$/
.exec(prevString);
if (r != null)
{
@@ -673,7 +673,6 @@ function tryIndentAfterSomeKeywords_ch(line)
{
var prevPrevString = stripComment(line - 2);
dbg("tryIndentAfterSomeKeywords_ch prevPrevString='"+prevPrevString+"'");
- dbg("tryIndentAfterSomeKeywords_ch prevPrevString2='"+document.line(line-2)+"'");
if (prevPrevString.endsWith('}'))
result = document.firstColumn(line - 2);
else if (prevPrevString.match(/^\s*[\])>]/))
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic