Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMickael Istria2021-09-20 04:11:53 -0400
committerMickael Istria2021-09-20 10:33:17 -0400
commit91f4d2bc8bca4c63984ce26e13cd26895e950d1e (patch)
treebed9b143ed36fe69f185bad1ad90bc9920d20c79 /org.eclipse.jface.text
parent3d6e291eefa26cd0a9218bd0044943e16ca07b33 (diff)
downloadeclipse.platform.text-91f4d2bc8bca4c63984ce26e13cd26895e950d1e.tar.gz
eclipse.platform.text-91f4d2bc8bca4c63984ce26e13cd26895e950d1e.tar.xz
eclipse.platform.text-91f4d2bc8bca4c63984ce26e13cd26895e950d1e.zip
Bug 575872 - Paste is brokenI20210920-1800
Change-Id: I509a09555789b634e956b81e89ceb1150f45af6a Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/185587 Tested-by: Platform Bot <platform-bot@eclipse.org> Reviewed-by: Mickael Istria <mistria@redhat.com>
Diffstat (limited to 'org.eclipse.jface.text')
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/TextViewer.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/TextViewer.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/TextViewer.java
index 7938bc588..d88674193 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/TextViewer.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/TextViewer.java
@@ -3981,7 +3981,7 @@ public class TextViewer extends Viewer implements
}
private void delete() {
- if (!fTextWidget.getBlockSelection() && fTextWidget.getSelectionRanges().length < 2) {
+ if (!fTextWidget.getBlockSelection() && isWidgetSelectionSingleRange()) {
fTextWidget.invokeAction(ST.DELETE_NEXT);
} else {
wrapCompoundChange(() -> {
@@ -3997,9 +3997,13 @@ public class TextViewer extends Viewer implements
fireSelectionChanged(selection.x, selection.y);
}
+ private boolean isWidgetSelectionSingleRange() {
+ return fTextWidget.getSelectionRanges().length <= 2;
+ }
+
private void paste() {
// ignoreAutoEditStrategies(true);
- if (fTextWidget.getSelectionRanges().length < 2) { // single selection
+ if (isWidgetSelectionSingleRange()) { // single selection
fTextWidget.paste();
} else {
wrapCompoundChange(() -> {

Back to the top