Skip to content

Commit

Permalink
Fix bug in symbol rename
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Sherman <[email protected]>
  • Loading branch information
bentsherman committed Nov 23, 2024
1 parent 2fb2987 commit f80cc91
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,10 @@ public String getSourceText(ASTNode node, boolean leadingIndent, int maxLines) {
var last = node.getLastLineNumber();
var firstCol = node.getColumnNumber();
var lastCol = node.getLastColumnNumber();
if( maxLines != -1 && first + maxLines < last )
last = first + maxLines;
for( int i = first; i <= last; i++ ) {
var lastWithMax = maxLines != -1 && first + maxLines < last
? first + maxLines - 1
: last;
for( int i = first; i <= lastWithMax; i++ ) {
var line = sourceUnit.getSource().getLine(i, null);

if( i == first && leadingIndent ) {
Expand Down

0 comments on commit f80cc91

Please sign in to comment.