Changeset View
Changeset View
Standalone View
Standalone View
src/script/data/indentation/cstyle.js
Context not available. | |||||
756 | var prevFirstPos = document.firstColumn(line - 1); | 756 | var prevFirstPos = document.firstColumn(line - 1); | ||
---|---|---|---|---|---|
757 | var lastPos = document.lastColumn(line); | 757 | var lastPos = document.lastColumn(line); | ||
758 | 758 | | |||
759 | dbg("firstPos: " + firstPos); | 759 | dbg("firstPos: " + firstPos); | ||
760 | dbg("column..: " + column); | 760 | dbg("column..: " + column); | ||
761 | dbg("char : " + c); | ||||
761 | 762 | | |||
762 | if (firstPos == column - 1 && c == '{') { | 763 | if (firstPos == column - 1 && c == '{') { | ||
763 | // todo: maybe look for if etc. | 764 | // todo: maybe look for if etc. | ||
Context not available. | |||||
785 | } else if (cfgSnapSlash && c == '/' && lastPos == column - 1) { | 786 | } else if (cfgSnapSlash && c == '/' && lastPos == column - 1) { | ||
786 | // try to snap the string "* /" to "*/" | 787 | // try to snap the string "* /" to "*/" | ||
787 | var currentString = document.line(line); | 788 | var currentString = document.line(line); | ||
788 | if (currentString.search(/^(\s*)\*\s+\/\s*$/) != -1) { | 789 | var regex = /^(\s*)\*\s+\/\s*$/; | ||
790 | // Doing the follow test as (currentString.search(/^(\s*)\*\s+\/\s*$/) != -1) | ||||
791 | // triggers a bug in QtQml where RegExp.$1 ends up empty. | ||||
792 | if (regex.test(currentString)) { | ||||
789 | currentString = RegExp.$1 + "*/"; | 793 | currentString = RegExp.$1 + "*/"; | ||
790 | document.editBegin(); | 794 | document.editBegin(); | ||
791 | document.removeLine(line); | 795 | document.removeLine(line); | ||
Context not available. |