mirror of
https://github.com/processing/processing4.git
synced 2026-03-01 18:24:34 +01:00
fix for bug #349 with selection chars, more normalization of key commands
This commit is contained in:
@@ -747,11 +747,17 @@ public abstract class InputHandler extends KeyAdapter
|
||||
return;
|
||||
}
|
||||
|
||||
if(select)
|
||||
textArea.select(textArea.getMarkPosition(),
|
||||
caret + 1);
|
||||
else
|
||||
textArea.setCaretPosition(caret + 1);
|
||||
if (select) {
|
||||
textArea.select(textArea.getMarkPosition(), caret+1);
|
||||
} else {
|
||||
int start = textArea.getSelectionStart();
|
||||
int end = textArea.getSelectionEnd();
|
||||
if (start != end) {
|
||||
textArea.select(end, end);
|
||||
} else {
|
||||
textArea.setCaretPosition(caret + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -899,11 +905,17 @@ public abstract class InputHandler extends KeyAdapter
|
||||
return;
|
||||
}
|
||||
|
||||
if(select)
|
||||
textArea.select(textArea.getMarkPosition(),
|
||||
caret - 1);
|
||||
else
|
||||
textArea.setCaretPosition(caret - 1);
|
||||
if (select) {
|
||||
textArea.select(textArea.getMarkPosition(), caret-1);
|
||||
} else {
|
||||
int start = textArea.getSelectionStart();
|
||||
int end = textArea.getSelectionEnd();
|
||||
if (start != end) {
|
||||
textArea.select(start, start);
|
||||
} else {
|
||||
textArea.setCaretPosition(caret - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user