Skip to content

Commit 32be7d9

Browse files
Refactored code
1 parent b336c49 commit 32be7d9

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/main/kotlin/com/harsh/jumpinglines/jumps/JumpBackwardLines.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ class JumpBackwardLines : DumbAwareAction() {
3333
)
3434

3535
// Calculate the new caret position
36-
val currentLineNumber: Int = document.getLineNumber(targetOffset)
36+
val targetLineNumber: Int = document.getLineNumber(targetOffset)
3737
val currentColumn = caretModel.logicalPosition.column
3838

3939
caretModel.moveToOffset(targetOffset)
4040

4141
// Scrolling editor along with the cursor
42-
val newPosition = LogicalPosition(currentLineNumber, currentColumn)
42+
val newPosition = LogicalPosition(targetLineNumber, currentColumn)
4343
caretModel.moveToLogicalPosition(newPosition)
4444

4545
// Remove selection blocks before jumping

src/main/kotlin/com/harsh/jumpinglines/jumps/JumpForwardLines.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ class JumpForwardLines : DumbAwareAction() {
3434
)
3535

3636
// Calculate the new caret position
37-
val currentLineNumber: Int = document.getLineNumber(targetOffset)
37+
val targetLineNumber: Int = document.getLineNumber(targetOffset)
3838
val currentColumn = caretModel.logicalPosition.column
3939

4040
caretModel.moveToOffset(targetOffset)
4141

4242
// Scrolling editor along with the cursor
43-
val newPosition = LogicalPosition(currentLineNumber, currentColumn)
43+
val newPosition = LogicalPosition(targetLineNumber, currentColumn)
4444
caretModel.moveToLogicalPosition(newPosition)
4545

4646
// Remove selection blocks before jumping

src/main/resources/META-INF/plugin.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@
7878
7979
<b>1.8 (2024-07-05)</b><br/>
8080
+++++++++++++++<br/>
81-
Cursor can jump over folded blocks.
82-
Fixed behaviour of Jump on Middle action.
81+
Cursor can jump over folded blocks.<br/>
82+
Fixed behaviour of Jump on Middle action.<br/>
8383
Jumping is allowed while indexing.<br/><br/>
8484
8585
<b>1.7 (2024-04-14)</b><br/>
8686
+++++++++++++++<br/>
87-
Prevented Jumping on Find dialog and Replace dialog.
87+
Prevented Jumping on Find dialog and Replace dialog.<br/>
8888
Showing Information Notification if the "Jumping" is attempted outside the editor.<br/><br/>
8989
9090
<b>1.6.1 (2024-03-20)</b><br/>
@@ -127,4 +127,5 @@
127127
128128
]]>
129129
</change-notes>
130+
130131
</idea-plugin>

0 commit comments

Comments
 (0)