mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 11:05:12 +00:00
Smart tab completion: replace till next separator
This commit is contained in:
1 parent
02ce0912c7
commit
ff7fbd411d
2 files changed
+44
-1
No files matched your search
@@ -489,6 +489,16 @@ public class GuiScriptTextArea extends GuiNpcTextField {
|
||||
scrollToCursor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void replaceTextRange(String text, int startPosition, int endPosition) {
|
||||
// Replace text from startPosition to endPosition
|
||||
String before = GuiScriptTextArea.this.text.substring(0, startPosition);
|
||||
String after = GuiScriptTextArea.this.text.substring(endPosition);
|
||||
setText(before + text + after);
|
||||
selection.reset(startPosition + text.length());
|
||||
scrollToCursor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCursorPosition() {
|
||||
return selection.getCursorPosition();
|
||||
|
||||
Reference in new issue
Block a user