Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fabioz committed Sep 30, 2024
1 parent 411236f commit 6202d9f
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,11 @@ public static int getFirstCharRelativePosition(IDocument doc, int cursorOffset)
*/
public static int getFirstCharPosition(IDocument doc, int cursorOffset) throws BadLocationException {
IRegion region;
region = doc.getLineInformationOfOffset(cursorOffset);
try {
region = doc.getLineInformationOfOffset(cursorOffset);
} catch (BadLocationException e) {
throw new BadLocationException("Error: bad offset: " + cursorOffset + " doc len: " + doc.getLength());
}
int offset = region.getOffset();
return offset + getFirstCharRelativePosition(doc, cursorOffset);
}
Expand Down Expand Up @@ -1219,7 +1223,7 @@ public String getContentsFromLineRange(int startLine, int endLine) {
*/
public static boolean stillInTok(String string, int j) {
char c = string.charAt(j);

return c != '\n' && c != '\r' && c != ' ' && c != '.' && c != '(' && c != ')' && c != ',' && c != ']'
&& c != '[' && c != '#' && c != '\'' && c != '"';
}
Expand Down

0 comments on commit 6202d9f

Please sign in to comment.