editor, allow action 'jump to definition' to work on the doc loaded in the split view

This commit is contained in:
Basile Burg 2015-12-16 05:49:02 +01:00
parent f40804ed85
commit 85448a52f5
3 changed files with 25 additions and 3 deletions

View File

@ -69,6 +69,7 @@ type
function getCurrentPage: TCEPage;
function getPageCount: integer;
function getPage(index: integer): TCEPage;
function getSplitPage: TCEPage;
procedure changedNotify;
procedure updateButtonsState;
@ -83,6 +84,7 @@ type
procedure movePageRight;
procedure movePageLeft;
property splitPage: TCEPage read getSplitPage;
property currentPage: TCEPage read getCurrentPage write setCurrentPage;
property pageIndex: integer read fPageIndex write setPageIndex;
property pageCount: integer read getPageCount;
@ -373,6 +375,14 @@ begin
exit(TCEPage(fPages.Items[index]));
end;
function TCEPageControl.getSplitPage: TCEPage;
begin
if fSplittedPageIndex = -1 then
exit(nil)
else
exit(getPage(fSplittedPageIndex));
end;
procedure TCEPageControl.movePageRight;
begin
if fPageIndex = fPages.Count-1 then

View File

@ -199,6 +199,8 @@ begin
exit('ICEMultiDocHandler');
end;
//TODO-cfeature: jump to definition, don't open/select tab if origin is in right split view
function TCEEditorWidget.documentCount: Integer;
begin
exit(PageControl.PageCount);
@ -347,6 +349,7 @@ end;
procedure TCEEditorWidget.getSymbolLoc;
var
page: TCEPage;
srcpos, i, sum, linelen: Integer;
fname: string;
len: byte;
@ -354,8 +357,16 @@ begin
if not DcdWrapper.available then exit;
//
DcdWrapper.getDeclFromCursor(fname, srcpos);
if fname <> fDoc.fileName then if fileExists(fname) then
openDocument(fname);
if (fname <> fDoc.fileName) and fileExists(fname) then
begin
page := pageControl.splitPage;
if assigned(page) then
begin
fDoc := TCESynMemo(page.Controls[0]);
if fDoc.fileName <> fname then
openDocument(fname);
end;
end;
if srcpos <> -1 then
begin
sum := 0;

View File

@ -2,4 +2,5 @@
- project, output options, screenshot is outdated.
- project config widget, base/overridden config specifications. Note about pre/post build proc as their options cant be overridden.
- project config widget, base/overridden config. screenshot for widget view 'All categories'.
- applications options (MRU & reload last stuff).
- applications options (MRU & reload last stuff).
- editor, toolbar description, split view description + screenshot.