mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 20:07:32 +00:00
Fixed GoToLine line's last column going to first col in next line
This commit is contained in:
1 parent
67b2ba16dd
commit
b4fb4765f5
1 file changed
+2
-1
@@ -190,7 +190,8 @@ public class GuiScriptTextArea extends GuiNpcTextField {
|
||||
int lineLength = ld.end - ld.start;
|
||||
|
||||
// Convert 1-indexed column to 0-indexed, clamp to line length
|
||||
int col = Math.max(0, Math.min(column - 1, lineLength));
|
||||
// lineLength - 1 because the line's end is the start of the next line
|
||||
int col = Math.max(0, Math.min(column - 1, lineLength - 1));
|
||||
int position = ld.start + col;
|
||||
|
||||
// Set cursor position
|
||||
|
||||
Reference in new issue
Block a user