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