diff --git a/plugin/debugger/src/main/java/com/perl5/lang/perl/debugger/PerlStackFrame.java b/plugin/debugger/src/main/java/com/perl5/lang/perl/debugger/PerlStackFrame.java index 47de4ad2d2..e489e9a691 100644 --- a/plugin/debugger/src/main/java/com/perl5/lang/perl/debugger/PerlStackFrame.java +++ b/plugin/debugger/src/main/java/com/perl5/lang/perl/debugger/PerlStackFrame.java @@ -85,7 +85,7 @@ public PerlStackFrame(PerlStackFrameDescriptor frameDescriptor, PerlExecutionSta @Override public void customizePresentation(@NotNull ColoredTextContainer component) { @NlsSafe var frameName = - String.join(":", myFrameDescriptor.getFileDescriptor().getNameOrPath(), String.valueOf(myFrameDescriptor.getLine())); + String.join(":", myFrameDescriptor.getFileDescriptor().getNameOrPath(), String.valueOf(myFrameDescriptor.getOneBasedLine())); component.append(frameName, SimpleTextAttributes.REGULAR_ATTRIBUTES); component.setIcon(AllIcons.Debugger.Frame); } @@ -94,7 +94,7 @@ public void customizePresentation(@NotNull ColoredTextContainer component) { public @Nullable XSourcePosition getSourcePosition() { VirtualFile virtualFile = myVirtualFile.getValue(); if (virtualFile != null) { - return XSourcePositionImpl.create(virtualFile, myFrameDescriptor.getLine()); + return XSourcePositionImpl.create(virtualFile, myFrameDescriptor.getZeroBasedLine()); } return super.getSourcePosition(); } diff --git a/plugin/debugger/src/main/java/com/perl5/lang/perl/debugger/protocol/PerlStackFrameDescriptor.java b/plugin/debugger/src/main/java/com/perl5/lang/perl/debugger/protocol/PerlStackFrameDescriptor.java index 6b33d4a57a..bad9995375 100644 --- a/plugin/debugger/src/main/java/com/perl5/lang/perl/debugger/protocol/PerlStackFrameDescriptor.java +++ b/plugin/debugger/src/main/java/com/perl5/lang/perl/debugger/protocol/PerlStackFrameDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2022 Alexandr Evstigneev + * Copyright 2015-2023 Alexandr Evstigneev * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,10 +33,14 @@ public PerlLoadedFileDescriptor getFileDescriptor() { return file; } - public int getLine() { + public int getZeroBasedLine() { return line; } + public int getOneBasedLine() { + return line + 1; + } + public PerlValueDescriptor[] getLexicals() { return lexicals; }