Skip to content

Commit

Permalink
[FEATURE] skip comment lines, e.g. for structure view & table editor
Browse files Browse the repository at this point in the history
  • Loading branch information
SeeSharpSoft committed Jul 18, 2020
1 parent b847b35 commit 80cb6ce
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -203,6 +203,11 @@ public static CsvColumnInfoMap<PsiElement> createColumnInfoMap(CsvFile csvFile)
int row = 0;
boolean hasComments = false;
for (CsvRecord record : records) {
// skip comment records
if (record.getComment() != null) {
hasComments = true;
continue;
}
int column = 0;
for (CsvField field : record.getFieldList()) {
Integer length = CsvHelper.getMaxTextLineLength(unquoteCsvValue(field.getText(), escapeCharacter));
Expand All @@ -214,9 +219,6 @@ public static CsvColumnInfoMap<PsiElement> createColumnInfoMap(CsvFile csvFile)
columnInfoMap.get(column).addElement(field, row, getFieldStartOffset(field), getFieldEndOffset(field));
++column;
}
if (record.getComment() != null) {
hasComments = true;
}
++row;
}
return new CsvColumnInfoMap(columnInfoMap, PsiTreeUtil.hasErrorElements(csvFile), hasComments);
Expand Down

0 comments on commit 80cb6ce

Please sign in to comment.