Skip to content

Commit

Permalink
Fixed issue #573.
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsschmidt1337 committed Aug 14, 2017
1 parent e8db7e9 commit 2c64a2b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/org/nschmidt/ldparteditor/helpers/compositetext/Inspector.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of

import org.eclipse.swt.custom.StyledText;
import org.nschmidt.ldparteditor.data.DatFile;
import org.nschmidt.ldparteditor.data.VertexManager;
import org.nschmidt.ldparteditor.widgets.TreeItem;

/**
Expand All @@ -44,6 +45,24 @@ public static void inspectTextIssues(StyledText cText, HashSet<TreeItem> issues,
if (issues.isEmpty())
return;

final VertexManager vm = datFile.getVertexManager();

vm.clearSelection();

final int lc = cText.getLineCount();
for (TreeItem ti : issues) {
if (ti.getData() == null) continue;
final int offset = (int) ti.getData();
if (offset < 0) continue;
final int line = cText.getLineAtOffset(offset) + 1;
if (line < 1 || line > lc) continue;
vm.addTextLineToSelection(line);
}

vm.setModified_NoSync();
vm.syncWithTextEditors(true);
vm.updateUnsavedStatus();

// FIXME Needs implementation!
}
}

0 comments on commit 2c64a2b

Please sign in to comment.