Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 6973bf8

Browse files
use JS String features instead of startsWith()
1 parent 422dcf5 commit 6973bf8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

settings/sql_developer/trivadis_custom_format.arbori

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -799,11 +799,11 @@ i8_save_indent_in_conditional_branch:
799799
for (var i in tokens) {
800800
var type = tokens[i].type
801801
var content = tokens[i].content.toLowerCase()
802-
if (type == Token.MACRO_SKIP && content.startsWith("$if ")) {
802+
if (type == Token.MACRO_SKIP && content.indexOf("$if ") == 0) {
803803
withinFirstBranch = true;
804804
continue;
805805
}
806-
if (withinFirstBranch && type == Token.MACRO_SKIP && content.startsWith("$")) {
806+
if (withinFirstBranch && type == Token.MACRO_SKIP && content.indexOf("$") == 0) {
807807
withinFirstBranch = false;
808808
continue;
809809
}
@@ -2552,7 +2552,7 @@ r5_commas:
25522552
struct.putNewline(commaNode.from, getIndentForComma(indentNextNode));
25532553
logger.fine(struct.getClass(), "r5_commas: fix indent before comma at " + commaNode.from + ".");
25542554
var comment = getLastCommentBetweenPos(commaNode.from-1, commaNode.to);
2555-
if (comment != null && comment.startsWith("--")) {
2555+
if (comment != null && comment.indexOf("--") == 0) {
25562556
// we must not remove the newline after a single-line comment (belongs to the single line comment)
25572557
} else {
25582558
// remove all whitespace before node
@@ -4026,7 +4026,7 @@ a18_indent_comment:
40264026
var getIndentBefore = function(pos) {
40274027
var indent = getIndent(pos);
40284028
var content = target.src.get(pos).content.toLowerCase();
4029-
if (content.startsWith("end")) {
4029+
if (content.indexOf("end") == 0) {
40304030
indent += getSpaces(indentSpaces);
40314031
if (target.src.get(pos+1).content.toLowerCase() == "case") {
40324032
indent += getSpaces(indentSpaces);

0 commit comments

Comments
 (0)