- enhancement: shortcut for goto definition/declaration

- change: ctrl+click symbol will goto definition, instead of got declaration
This commit is contained in:
Roy Qu 2022-03-19 15:33:15 +08:00
parent fc11f1223b
commit 12e772747c
3 changed files with 16 additions and 3 deletions

View File

@ -5,6 +5,8 @@ Red Panda C++ Version 1.0.1
- enhancement: press alt to switch to column selection mode while selection by mouse dragging in editor
- fix: order for parameters generated by auto link may not correct
- fix: corresponding '>' not correctly removed when deleting '<' in #include line
- enhancement: shortcut for goto definition/declaration
- change: ctrl+click symbol will goto definition, instead of got declaration
Red Panda C++ Version 1.0.0
- fix: calculation for code snippets's tab stop positions is not correct

View File

@ -1145,7 +1145,7 @@ void Editor::mouseReleaseEvent(QMouseEvent *event)
return;
}
} else {
gotoDeclaration(p);
gotoDefinition(p);
return;
}
}
@ -3849,8 +3849,13 @@ void Editor::gotoDefinition(const BufferCoord &pos)
}
QString filename;
int line;
if (statement->definitionFileName == mFilename && statement->definitionLine == pos.Line) {
filename = statement->fileName;
line = statement->line;
} else {
filename = statement->definitionFileName;
line = statement->definitionLine;
}
Editor* e = pMainWindow->editorList()->getEditorByFilename(filename);
if (e) {
e->setCaretPositionAndActivate(line,1);

View File

@ -2324,11 +2324,17 @@
<property name="text">
<string>Goto Declaration</string>
</property>
<property name="shortcut">
<string>Ctrl+Shift+G</string>
</property>
</action>
<action name="actionGoto_Definition">
<property name="text">
<string>Goto Definition</string>
</property>
<property name="shortcut">
<string>Ctrl+G</string>
</property>
</action>
<action name="actionFind_references">
<property name="text">