mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-10 12:03:16 +02:00
Make the open decl on includes a little safer.
This commit is contained in:
parent
8fe932e6c3
commit
94a68d1f4e
1 changed files with 2 additions and 1 deletions
|
@ -127,7 +127,8 @@ public class OpenDeclarationsAction extends SelectionParseAction {
|
||||||
if (!(preprocs[i] instanceof IASTPreprocessorIncludeStatement))
|
if (!(preprocs[i] instanceof IASTPreprocessorIncludeStatement))
|
||||||
continue;
|
continue;
|
||||||
IASTFileLocation loc = preprocs[i].getFileLocation();
|
IASTFileLocation loc = preprocs[i].getFileLocation();
|
||||||
if (loc.getFileName().equals(ast.getFilePath())
|
if (loc != null
|
||||||
|
&& loc.getFileName().equals(ast.getFilePath())
|
||||||
&& loc.getNodeOffset() < selectionStart
|
&& loc.getNodeOffset() < selectionStart
|
||||||
&& loc.getNodeOffset() + loc.getNodeLength() > selectionStart) {
|
&& loc.getNodeOffset() + loc.getNodeLength() > selectionStart) {
|
||||||
// Got it
|
// Got it
|
||||||
|
|
Loading…
Add table
Reference in a new issue