Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2014-11-27 16:01:26 +0000
committerUwe Stieber2014-12-16 10:15:57 +0000
commitf50eae0f94eaf0e925dadd12cbc8a7c19aea1e82 (patch)
tree9dcb9d57928e922e6068bf7a9481e9af27fec33f
parent208cb478a461310c704345acc6a77645e4f52fff (diff)
downloadorg.eclipse.tm-f50eae0f94eaf0e925dadd12cbc8a7c19aea1e82.tar.gz
org.eclipse.tm-f50eae0f94eaf0e925dadd12cbc8a7c19aea1e82.tar.xz
org.eclipse.tm-f50eae0f94eaf0e925dadd12cbc8a7c19aea1e82.zip
Bug 453393 - Add support for copying wrapped lines without line break
Change-Id: Id4e836854bffd4f58243018e240cac917bb04c73 Signed-off-by: Anton Leherbauer <anton.leherbauer@windriver.com>
-rw-r--r--rse/plugins/org.eclipse.rse.terminals.ui/META-INF/MANIFEST.MF4
-rw-r--r--rse/plugins/org.eclipse.rse.terminals.ui/pom.xml2
-rw-r--r--terminal/features/org.eclipse.tm.terminal.local-feature/feature.xml2
-rw-r--r--terminal/features/org.eclipse.tm.terminal.serial-feature/feature.xml2
-rw-r--r--terminal/features/org.eclipse.tm.terminal.ssh-feature/feature.xml2
-rw-r--r--terminal/features/org.eclipse.tm.terminal.telnet-feature/feature.xml2
-rw-r--r--terminal/features/org.eclipse.tm.terminal.test-feature/feature.xml2
-rw-r--r--terminal/features/org.eclipse.tm.terminal.view-feature/feature.xml2
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal.local/META-INF/MANIFEST.MF4
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal.local/pom.xml2
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal.serial/META-INF/MANIFEST.MF4
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal.serial/pom.xml2
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal.ssh/META-INF/MANIFEST.MF4
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal.ssh/pom.xml2
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshConnection.java7
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal.telnet/META-INF/MANIFEST.MF4
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal.telnet/pom.xml2
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetConnector.java5
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetOption.java11
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal.test/META-INF/MANIFEST.MF4
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal.test/pom.xml2
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/emulator/VT100EmulatorBackendTest.java52
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/AbstractITerminalTextDataTest.java19
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataWindowTest.java15
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal.view/META-INF/MANIFEST.MF4
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal.view/pom.xml2
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal/META-INF/MANIFEST.MF2
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal/pom.xml2
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100EmulatorBackend.java19
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/SynchronizedTerminalTextData.java9
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextData.java11
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataFastScroll.java11
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataSnapshot.java6
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataStore.java29
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataWindow.java12
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/AbstractTextCanvasModel.java2
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextData.java26
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextDataReadOnly.java13
38 files changed, 225 insertions, 80 deletions
diff --git a/rse/plugins/org.eclipse.rse.terminals.ui/META-INF/MANIFEST.MF b/rse/plugins/org.eclipse.rse.terminals.ui/META-INF/MANIFEST.MF
index 639149124..5703f247e 100644
--- a/rse/plugins/org.eclipse.rse.terminals.ui/META-INF/MANIFEST.MF
+++ b/rse/plugins/org.eclipse.rse.terminals.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.rse.terminals.ui;singleton:=true
-Bundle-Version: 1.2.100.qualifier
+Bundle-Version: 1.2.200.qualifier
Bundle-Activator: org.eclipse.rse.internal.terminals.ui.Activator
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.expressions,
@@ -12,7 +12,7 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.rse.core;bundle-version="[3.0.0,4.0.0)",
org.eclipse.rse.ui;bundle-version="[3.1.0,4.0.0)",
org.eclipse.rse.subsystems.terminals.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.tm.terminal;bundle-version="[3.2.0,3.3.0)"
+ org.eclipse.tm.terminal;bundle-version="[3.2.0,3.4.0)"
Bundle-ActivationPolicy: lazy
Eclipse-LazyStart: true
Bundle-Vendor: %providerName
diff --git a/rse/plugins/org.eclipse.rse.terminals.ui/pom.xml b/rse/plugins/org.eclipse.rse.terminals.ui/pom.xml
index f3d0f23ec..f1fad4b1f 100644
--- a/rse/plugins/org.eclipse.rse.terminals.ui/pom.xml
+++ b/rse/plugins/org.eclipse.rse.terminals.ui/pom.xml
@@ -10,6 +10,6 @@
</parent>
<groupId>org.eclipse.tm</groupId>
<artifactId>org.eclipse.rse.terminals.ui</artifactId>
- <version>1.2.100-SNAPSHOT</version>
+ <version>1.2.200-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/terminal/features/org.eclipse.tm.terminal.local-feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.local-feature/feature.xml
index 8c58ff35d..65fbbc427 100644
--- a/terminal/features/org.eclipse.tm.terminal.local-feature/feature.xml
+++ b/terminal/features/org.eclipse.tm.terminal.local-feature/feature.xml
@@ -43,7 +43,7 @@
<import plugin="org.eclipse.debug.core"/>
<import plugin="org.eclipse.debug.ui"/>
<import plugin="org.eclipse.jface"/>
- <import plugin="org.eclipse.tm.terminal" version="3.2.2" match="equivalent"/>
+ <import plugin="org.eclipse.tm.terminal" version="3.3.0" match="equivalent"/>
<import plugin="org.eclipse.tm.terminal.view" version="2.4.1" match="greaterOrEqual"/>
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.ui.externaltools"/>
diff --git a/terminal/features/org.eclipse.tm.terminal.serial-feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.serial-feature/feature.xml
index 84c9fcd21..d7939c87a 100644
--- a/terminal/features/org.eclipse.tm.terminal.serial-feature/feature.xml
+++ b/terminal/features/org.eclipse.tm.terminal.serial-feature/feature.xml
@@ -38,7 +38,7 @@
<requires>
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.tm.terminal" version="3.2.2" match="equivalent"/>
+ <import plugin="org.eclipse.tm.terminal" version="3.3.0" match="equivalent"/>
</requires>
<plugin
diff --git a/terminal/features/org.eclipse.tm.terminal.ssh-feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.ssh-feature/feature.xml
index e2d51b3d8..189124c5f 100644
--- a/terminal/features/org.eclipse.tm.terminal.ssh-feature/feature.xml
+++ b/terminal/features/org.eclipse.tm.terminal.ssh-feature/feature.xml
@@ -38,7 +38,7 @@
<requires>
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.tm.terminal" version="3.2.2" match="equivalent"/>
+ <import plugin="org.eclipse.tm.terminal" version="3.3.0" match="equivalent"/>
<import plugin="org.eclipse.jsch.core" version="1.0.0" match="compatible"/>
<import plugin="com.jcraft.jsch" version="0.1.31" match="compatible"/>
</requires>
diff --git a/terminal/features/org.eclipse.tm.terminal.telnet-feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.telnet-feature/feature.xml
index 8b7b79724..a4f39c125 100644
--- a/terminal/features/org.eclipse.tm.terminal.telnet-feature/feature.xml
+++ b/terminal/features/org.eclipse.tm.terminal.telnet-feature/feature.xml
@@ -38,7 +38,7 @@
<requires>
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.tm.terminal" version="3.2.2" match="equivalent"/>
+ <import plugin="org.eclipse.tm.terminal" version="3.3.0" match="equivalent"/>
</requires>
<plugin
diff --git a/terminal/features/org.eclipse.tm.terminal.test-feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.test-feature/feature.xml
index e0e25bd0a..76c233372 100644
--- a/terminal/features/org.eclipse.tm.terminal.test-feature/feature.xml
+++ b/terminal/features/org.eclipse.tm.terminal.test-feature/feature.xml
@@ -38,7 +38,7 @@
<requires>
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.tm.terminal" version="3.2.2" match="equivalent"/>
+ <import plugin="org.eclipse.tm.terminal" version="3.3.0" match="equivalent"/>
<import plugin="org.junit" version="3.8.1" match="compatible"/>
<import plugin="org.apache.ant"/>
</requires>
diff --git a/terminal/features/org.eclipse.tm.terminal.view-feature/feature.xml b/terminal/features/org.eclipse.tm.terminal.view-feature/feature.xml
index 33cae33d0..c540c0a6e 100644
--- a/terminal/features/org.eclipse.tm.terminal.view-feature/feature.xml
+++ b/terminal/features/org.eclipse.tm.terminal.view-feature/feature.xml
@@ -39,7 +39,7 @@
<requires>
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.tm.terminal" version="3.2.2" match="equivalent"/>
+ <import plugin="org.eclipse.tm.terminal" version="3.3.0" match="equivalent"/>
</requires>
<plugin
diff --git a/terminal/plugins/org.eclipse.tm.terminal.local/META-INF/MANIFEST.MF b/terminal/plugins/org.eclipse.tm.terminal.local/META-INF/MANIFEST.MF
index ad5a366b6..1848fa724 100644
--- a/terminal/plugins/org.eclipse.tm.terminal.local/META-INF/MANIFEST.MF
+++ b/terminal/plugins/org.eclipse.tm.terminal.local/META-INF/MANIFEST.MF
@@ -2,11 +2,11 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.tm.terminal.local;singleton:=true
-Bundle-Version: 0.2.200.qualifier
+Bundle-Version: 0.2.300.qualifier
Bundle-Activator: org.eclipse.tm.internal.terminal.local.LocalTerminalActivator
Bundle-Localization: plugin
Bundle-Vendor: %providerName
-Require-Bundle: org.eclipse.tm.terminal;bundle-version="[3.2.0,3.3.0)",
+Require-Bundle: org.eclipse.tm.terminal;bundle-version="[3.2.0,3.4.0)",
org.eclipse.cdt.core;bundle-version="[5.2.0,6.0.0)",
org.eclipse.core.runtime,
org.eclipse.debug.core;bundle-version="3.6",
diff --git a/terminal/plugins/org.eclipse.tm.terminal.local/pom.xml b/terminal/plugins/org.eclipse.tm.terminal.local/pom.xml
index 28e944049..df03713ce 100644
--- a/terminal/plugins/org.eclipse.tm.terminal.local/pom.xml
+++ b/terminal/plugins/org.eclipse.tm.terminal.local/pom.xml
@@ -10,6 +10,6 @@
</parent>
<groupId>org.eclipse.tm</groupId>
<artifactId>org.eclipse.tm.terminal.local</artifactId>
- <version>0.2.200.qualifier</version>
+ <version>0.2.300.qualifier</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/terminal/plugins/org.eclipse.tm.terminal.serial/META-INF/MANIFEST.MF b/terminal/plugins/org.eclipse.tm.terminal.serial/META-INF/MANIFEST.MF
index 5c007ac82..af62eba6b 100644
--- a/terminal/plugins/org.eclipse.tm.terminal.serial/META-INF/MANIFEST.MF
+++ b/terminal/plugins/org.eclipse.tm.terminal.serial/META-INF/MANIFEST.MF
@@ -2,12 +2,12 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.tm.terminal.serial;singleton:=true
-Bundle-Version: 2.1.300.qualifier
+Bundle-Version: 2.1.400.qualifier
Bundle-Localization: plugin
Import-Package: gnu.io;resolution:=optional
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
- org.eclipse.tm.terminal;bundle-version="[3.2.0,3.3.0)"
+ org.eclipse.tm.terminal;bundle-version="[3.2.0,3.4.0)"
Bundle-ActivationPolicy: lazy
Eclipse-LazyStart: true
Eclipse-BuddyPolicy: ext
diff --git a/terminal/plugins/org.eclipse.tm.terminal.serial/pom.xml b/terminal/plugins/org.eclipse.tm.terminal.serial/pom.xml
index aff58b57e..ee07be1d7 100644
--- a/terminal/plugins/org.eclipse.tm.terminal.serial/pom.xml
+++ b/terminal/plugins/org.eclipse.tm.terminal.serial/pom.xml
@@ -10,6 +10,6 @@
</parent>
<groupId>org.eclipse.tm</groupId>
<artifactId>org.eclipse.tm.terminal.serial</artifactId>
- <version>2.1.300.qualifier</version>
+ <version>2.1.400.qualifier</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/terminal/plugins/org.eclipse.tm.terminal.ssh/META-INF/MANIFEST.MF b/terminal/plugins/org.eclipse.tm.terminal.ssh/META-INF/MANIFEST.MF
index 55ab410df..cfbb357f8 100644
--- a/terminal/plugins/org.eclipse.tm.terminal.ssh/META-INF/MANIFEST.MF
+++ b/terminal/plugins/org.eclipse.tm.terminal.ssh/META-INF/MANIFEST.MF
@@ -2,12 +2,12 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.tm.terminal.ssh;singleton:=true
-Bundle-Version: 2.1.300.qualifier
+Bundle-Version: 2.1.400.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
- org.eclipse.tm.terminal;bundle-version="[3.2.0,3.3.0)",
+ org.eclipse.tm.terminal;bundle-version="[3.2.0,3.4.0)",
com.jcraft.jsch;bundle-version="[0.1.31,1.0.0)",
org.eclipse.jsch.core;bundle-version="[1.0.0,2.0.0)"
Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/terminal/plugins/org.eclipse.tm.terminal.ssh/pom.xml b/terminal/plugins/org.eclipse.tm.terminal.ssh/pom.xml
index 9f8f166a7..a2e94c125 100644
--- a/terminal/plugins/org.eclipse.tm.terminal.ssh/pom.xml
+++ b/terminal/plugins/org.eclipse.tm.terminal.ssh/pom.xml
@@ -10,6 +10,6 @@
</parent>
<groupId>org.eclipse.tm</groupId>
<artifactId>org.eclipse.tm.terminal.ssh</artifactId>
- <version>2.1.300.qualifier</version>
+ <version>2.1.400.qualifier</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshConnection.java b/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshConnection.java
index 38d9608cb..8bf6f2879 100644
--- a/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshConnection.java
+++ b/terminal/plugins/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshConnection.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2008 Wind River Systems, Inc. and others.
+ * Copyright (c) 2006, 2014 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -20,6 +20,7 @@
* Michael Scharf (Wind River) - 240420: [terminal][ssh]Channel is not closed when the connection is closed with the close button
* Martin Oberhuber (Wind River) - [206919] Improve SSH Terminal Error Reporting
* Andrei Sobolev (Xored) - [250456] Ssh banner message causes IllegalArgumentException popup
+ * Anton Leherbauer (Wind River) - [453393] Add support for copying wrapped lines without line break
*******************************************************************************/
package org.eclipse.tm.internal.terminal.ssh;
@@ -137,7 +138,9 @@ class SshConnection extends Thread {
if(!isSessionConnected())
return;
ChannelShell channel=(ChannelShell) session.openChannel("shell"); //$NON-NLS-1$
- channel.setPtyType("ansi"); //$NON-NLS-1$
+ channel.setPtyType("xterm"); //$NON-NLS-1$
+ // TERM=xterm implies VT100 line wrapping mode
+ fControl.setVT100LineWrapping(true);
channel.connect();
// maybe the terminal was disconnected while we were connecting
diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/META-INF/MANIFEST.MF b/terminal/plugins/org.eclipse.tm.terminal.telnet/META-INF/MANIFEST.MF
index 44fb88a1e..f3aea71b3 100644
--- a/terminal/plugins/org.eclipse.tm.terminal.telnet/META-INF/MANIFEST.MF
+++ b/terminal/plugins/org.eclipse.tm.terminal.telnet/META-INF/MANIFEST.MF
@@ -2,11 +2,11 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.tm.terminal.telnet;singleton:=true
-Bundle-Version: 2.1.300.qualifier
+Bundle-Version: 2.1.400.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
- org.eclipse.tm.terminal;bundle-version="[3.2.0,3.3.0)"
+ org.eclipse.tm.terminal;bundle-version="[3.2.0,3.4.0)"
Bundle-RequiredExecutionEnvironment: J2SE-1.4
Export-Package: org.eclipse.tm.internal.terminal.telnet;x-internal:=true
diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/pom.xml b/terminal/plugins/org.eclipse.tm.terminal.telnet/pom.xml
index 559d057d7..018e59a1f 100644
--- a/terminal/plugins/org.eclipse.tm.terminal.telnet/pom.xml
+++ b/terminal/plugins/org.eclipse.tm.terminal.telnet/pom.xml
@@ -10,6 +10,6 @@
</parent>
<groupId>org.eclipse.tm</groupId>
<artifactId>org.eclipse.tm.terminal.telnet</artifactId>
- <version>2.1.300.qualifier</version>
+ <version>2.1.400.qualifier</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetConnector.java b/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetConnector.java
index d9e57a070..0fde60e53 100644
--- a/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetConnector.java
+++ b/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetConnector.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2009 Wind River Systems, Inc. and others.
+ * Copyright (c) 2005, 2014 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -16,6 +16,7 @@
* Martin Oberhuber (Wind River) - [225853][api] Provide more default functionality in TerminalConnectorImpl
* Sean Adams (Cisco) - [231959][terminal][telnet] NPE in TelnetConnector.java
* David Sciamma (Anyware-Tech) - [288254][telnet] local echo is always disabled
+ * Anton Leherbauer (Wind River) - [453393] Add support for copying wrapped lines without line break
*******************************************************************************/
package org.eclipse.tm.internal.terminal.telnet;
@@ -50,6 +51,8 @@ public class TelnetConnector extends TerminalConnectorImpl {
super.connect(control);
fWidth=-1;
fHeight=-1;
+ // TERM=xterm implies VT100 line wrapping mode
+ control.setVT100LineWrapping(true);
TelnetConnectWorker worker = new TelnetConnectWorker(this,control);
worker.start();
}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetOption.java b/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetOption.java
index 76596a430..835e2e1da 100644
--- a/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetOption.java
+++ b/terminal/plugins/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetOption.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2009 Wind River Systems, Inc. and others.
+ * Copyright (c) 2005, 2014 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,6 +14,7 @@
* Michael Scharf (Wind River) - split into core, view and connector plugins
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
* Martin Oberhuber (Wind River) - [267181] Fix telnet option negotiation loop
+ * Anton Leherbauer (Wind River) - [453393] Add support for copying wrapped lines without line break
*******************************************************************************/
package org.eclipse.tm.internal.terminal.telnet;
@@ -504,7 +505,7 @@ class TelnetOption implements TelnetCodes
/**
* This method handles a subnegotiation command received from the remote endpoint.
* Currently, the only subnegotiation we handle is when the remote endpoint
- * commands us to send our terminal type (which is "ansi").
+ * commands us to send our terminal type (which is "xterm").
*
* @param subnegotiationData An array of bytes containing a TELNET
* subnegotiation command received from the
@@ -526,11 +527,11 @@ class TelnetOption implements TelnetCodes
// Tell the remote endpoint our terminal type is "ansi" using this sequence
// of TELNET protocol bytes:
//
- // IAC SB TERMINAL-TYPE IS a n s i IAC SE
+ // IAC SB TERMINAL-TYPE IS x t e r m IAC SE
byte[] terminalTypeData = { TELNET_IAC, TELNET_SB,
- TELNET_OPTION_TERMINAL_TYPE, TELNET_IS, (byte) 'a',
- (byte) 'n', (byte) 's', (byte) 'i', TELNET_IAC, TELNET_SE };
+ TELNET_OPTION_TERMINAL_TYPE, TELNET_IS, (byte) 'x',
+ (byte) 't', (byte) 'e', (byte) 'r', (byte) 'm', TELNET_IAC, TELNET_SE };
try {
outputStream.write(terminalTypeData);
diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/META-INF/MANIFEST.MF b/terminal/plugins/org.eclipse.tm.terminal.test/META-INF/MANIFEST.MF
index 0b7fa8021..f0251b0db 100644
--- a/terminal/plugins/org.eclipse.tm.terminal.test/META-INF/MANIFEST.MF
+++ b/terminal/plugins/org.eclipse.tm.terminal.test/META-INF/MANIFEST.MF
@@ -2,11 +2,11 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.tm.terminal.test;singleton:=true
-Bundle-Version: 2.2.100.qualifier
+Bundle-Version: 2.3.0.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Require-Bundle: org.junit,
- org.eclipse.tm.terminal;bundle-version="[3.2.0,3.3.0)",
+ org.eclipse.tm.terminal;bundle-version="[3.3.0,4.0.0)",
org.eclipse.core.runtime,
org.eclipse.ui
Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/pom.xml b/terminal/plugins/org.eclipse.tm.terminal.test/pom.xml
index 7d8881176..5f40291cd 100644
--- a/terminal/plugins/org.eclipse.tm.terminal.test/pom.xml
+++ b/terminal/plugins/org.eclipse.tm.terminal.test/pom.xml
@@ -10,7 +10,7 @@
</parent>
<groupId>org.eclipse.tm</groupId>
<artifactId>org.eclipse.tm.terminal.test</artifactId>
- <version>2.2.100.qualifier</version>
+ <version>2.3.0.qualifier</version>
<packaging>eclipse-test-plugin</packaging>
<build>
<plugins>
diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/emulator/VT100EmulatorBackendTest.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/emulator/VT100EmulatorBackendTest.java
index 9e711db97..a7b83e988 100644
--- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/emulator/VT100EmulatorBackendTest.java
+++ b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/emulator/VT100EmulatorBackendTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007, 2014 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
* Contributors:
* Michael Scharf (Wind River) - initial API and implementation
* Martin Oberhuber (Wind River) - [168197] Fix Terminal for CDC-1.1/Foundation-1.1
+ * Anton Leherbauer (Wind River) - [453393] Add support for copying wrapped lines without line break
*******************************************************************************/
package org.eclipse.tm.internal.terminal.emulator;
@@ -1234,4 +1235,53 @@ public class VT100EmulatorBackendTest extends TestCase {
assertEquals(3,vt100.getCursorColumn());
}
+ public void testVT100LineWrappingOn() {
+ ITerminalTextData term=makeITerminalTextData();
+ IVT100EmulatorBackend vt100=makeBakend(term);
+ term.setMaxHeight(10);
+ vt100.setDimensions(6, 4);
+ vt100.setVT100LineWrapping(true);
+ vt100.appendString("abcd");
+ vt100.setCursorColumn(0);
+ vt100.processNewline();
+ vt100.appendString("1234");
+ vt100.setCursorColumn(0);
+ vt100.processNewline();
+ assertEquals(2, vt100.getCursorLine());
+ }
+
+ public void testVT100LineWrappingOff() {
+ ITerminalTextData term=makeITerminalTextData();
+ IVT100EmulatorBackend vt100=makeBakend(term);
+ term.setMaxHeight(10);
+ vt100.setDimensions(6, 4);
+ vt100.setVT100LineWrapping(false);
+ vt100.appendString("abcd");
+ vt100.setCursorColumn(0);
+ vt100.processNewline();
+ vt100.appendString("1234");
+ vt100.setCursorColumn(0);
+ vt100.processNewline();
+ assertEquals(4, vt100.getCursorLine());
+ }
+
+ public void testWrappedLines() {
+ ITerminalTextData term=makeITerminalTextData();
+ IVT100EmulatorBackend vt100=makeBakend(term);
+ term.setMaxHeight(10);
+ vt100.setDimensions(6, 4);
+ vt100.setVT100LineWrapping(true);
+ vt100.appendString("abcd123");
+ vt100.setCursorColumn(0);
+ vt100.processNewline();
+ vt100.appendString("abc");
+ vt100.setCursorColumn(0);
+ vt100.processNewline();
+ vt100.appendString("1234abcd");
+ assertEquals(4, vt100.getCursorLine());
+ assertTrue(term.isWrappedLine(0));
+ assertFalse(term.isWrappedLine(1));
+ assertFalse(term.isWrappedLine(2));
+ assertTrue(term.isWrappedLine(3));
+ }
}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/AbstractITerminalTextDataTest.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/AbstractITerminalTextDataTest.java
index 493547a54..9eff106ef 100644
--- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/AbstractITerminalTextDataTest.java
+++ b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/AbstractITerminalTextDataTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007-2014 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* Michael Scharf (Wind River) - initial API and implementation
+ * Anton Leherbauer (Wind River) - [453393] Add support for copying wrapped lines without line break
*******************************************************************************/
package org.eclipse.tm.internal.terminal.model;
import junit.framework.TestCase;
@@ -812,6 +813,20 @@ abstract public class AbstractITerminalTextDataTest extends TestCase {
fillSimple(term,start);
term.scroll(line, n, shift);
assertEqualsSimple(result, toSimple(term));
-
+ }
+
+ public void testWrappedLines() {
+ ITerminalTextData term=makeITerminalTextData();
+ term.setDimensions(4, 4);
+ for (int i=0; i<term.getHeight(); ++i)
+ assertFalse(term.isWrappedLine(i));
+ term.setWrappedLine(0);
+ term.setWrappedLine(3);
+ assertTrue(term.isWrappedLine(0));
+ assertFalse(term.isWrappedLine(1));
+ assertFalse(term.isWrappedLine(2));
+ assertTrue(term.isWrappedLine(3));
+ term.cleanLine(0);
+ assertFalse(term.isWrappedLine(0));
}
}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataWindowTest.java b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataWindowTest.java
index 5e739176c..53a38d23f 100644
--- a/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataWindowTest.java
+++ b/terminal/plugins/org.eclipse.tm.terminal.test/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataWindowTest.java
@@ -475,7 +475,20 @@ public class TerminalTextDataWindowTest extends AbstractITerminalTextDataTest {
ITerminalTextData data=new TerminalTextData();
fillSimple(data,"abcd");
term.copy(data);
+ }
-
+ public void testWrappedLines() {
+ ITerminalTextData term=makeITerminalTextData();
+ term.setDimensions(4, 4);
+ for (int i=0; i<term.getHeight(); ++i)
+ assertFalse(term.isWrappedLine(i));
+ term.setWrappedLine(0); // outside window
+ term.setWrappedLine(3);
+ assertFalse(term.isWrappedLine(0));
+ assertFalse(term.isWrappedLine(1));
+ assertFalse(term.isWrappedLine(2));
+ assertTrue(term.isWrappedLine(3));
+ term.cleanLine(3);
+ assertFalse(term.isWrappedLine(3));
}
}
diff --git a/terminal/plugins/org.eclipse.tm.terminal.view/META-INF/MANIFEST.MF b/terminal/plugins/org.eclipse.tm.terminal.view/META-INF/MANIFEST.MF
index 553bbec51..eee6efc5b 100644
--- a/terminal/plugins/org.eclipse.tm.terminal.view/META-INF/MANIFEST.MF
+++ b/terminal/plugins/org.eclipse.tm.terminal.view/META-INF/MANIFEST.MF
@@ -2,12 +2,12 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.tm.terminal.view;singleton:=true
-Bundle-Version: 2.4.100.qualifier
+Bundle-Version: 2.4.200.qualifier
Bundle-Activator: org.eclipse.tm.internal.terminal.view.TerminalViewPlugin
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
- org.eclipse.tm.terminal;bundle-version="[3.2.0,3.3.0)"
+ org.eclipse.tm.terminal;bundle-version="[3.2.0,3.4.0)"
Bundle-ActivationPolicy: lazy
Eclipse-LazyStart: true
Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/terminal/plugins/org.eclipse.tm.terminal.view/pom.xml b/terminal/plugins/org.eclipse.tm.terminal.view/pom.xml
index e69f579d1..c08a08fbd 100644
--- a/terminal/plugins/org.eclipse.tm.terminal.view/pom.xml
+++ b/terminal/plugins/org.eclipse.tm.terminal.view/pom.xml
@@ -10,6 +10,6 @@
</parent>
<groupId>org.eclipse.tm</groupId>
<artifactId>org.eclipse.tm.terminal.view</artifactId>
- <version>2.4.100.qualifier</version>
+ <version>2.4.200.qualifier</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/terminal/plugins/org.eclipse.tm.terminal/META-INF/MANIFEST.MF b/terminal/plugins/org.eclipse.tm.terminal/META-INF/MANIFEST.MF
index 19d3c814b..b7973c8d0 100644
--- a/terminal/plugins/org.eclipse.tm.terminal/META-INF/MANIFEST.MF
+++ b/terminal/plugins/org.eclipse.tm.terminal/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.tm.terminal; singleton:=true
-Bundle-Version: 3.2.400.qualifier
+Bundle-Version: 3.3.0.qualifier
Bundle-Activator: org.eclipse.tm.internal.terminal.control.impl.TerminalPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/terminal/plugins/org.eclipse.tm.terminal/pom.xml b/terminal/plugins/org.eclipse.tm.terminal/pom.xml
index 517e362fc..37830302e 100644
--- a/terminal/plugins/org.eclipse.tm.terminal/pom.xml
+++ b/terminal/plugins/org.eclipse.tm.terminal/pom.xml
@@ -10,6 +10,6 @@
</parent>
<groupId>org.eclipse.tm</groupId>
<artifactId>org.eclipse.tm.terminal</artifactId>
- <version>3.2.400.qualifier</version>
+ <version>3.3.0.qualifier</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100EmulatorBackend.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100EmulatorBackend.java
index d5958d9c3..47b78f684 100644
--- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100EmulatorBackend.java
+++ b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100EmulatorBackend.java
@@ -293,9 +293,7 @@ public class VT100EmulatorBackend implements IVT100EmulatorBackend {
int i=0;
while (i < chars.length) {
if(fWrapPending) {
- doNewline();
- line=toAbsoluteLine(fCursorLine);
- setCursorColumn(0);
+ line = doLineWrap();
}
int n=Math.min(fColumns-fCursorColumn,chars.length-i);
fTerminal.setChars(line, fCursorColumn, chars, i, n, fStyle);
@@ -308,10 +306,7 @@ public class VT100EmulatorBackend implements IVT100EmulatorBackend {
setCursorColumn(col - 1);
fWrapPending = true;
} else {
- // immediate line wrapping
- doNewline();
- line=toAbsoluteLine(fCursorLine);
- setCursorColumn(0);
+ line = doLineWrap();
}
} else {
setCursorColumn(col);
@@ -320,6 +315,16 @@ public class VT100EmulatorBackend implements IVT100EmulatorBackend {
}
}
+ private int doLineWrap() {
+ int line;
+ line=toAbsoluteLine(fCursorLine);
+ fTerminal.setWrappedLine(line);
+ doNewline();
+ line=toAbsoluteLine(fCursorLine);
+ setCursorColumn(0);
+ return line;
+ }
+
/**
* MUST be called from a synchronized block!
*/
diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/SynchronizedTerminalTextData.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/SynchronizedTerminalTextData.java
index 0bbf8d257..96103a4a1 100644
--- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/SynchronizedTerminalTextData.java
+++ b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/SynchronizedTerminalTextData.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007, 2014 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse synchronized public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* Michael Scharf (Wind River) - initial API and implementation
+ * Anton Leherbauer (Wind River) - [453393] Add support for copying wrapped lines without line break
*******************************************************************************/
package org.eclipse.tm.internal.terminal.model;
@@ -97,4 +98,10 @@ public class SynchronizedTerminalTextData implements ITerminalTextData {
synchronized public void setMaxHeight(int height) {
fData.setMaxHeight(height);
}
+ synchronized public boolean isWrappedLine(int line) {
+ return fData.isWrappedLine(line);
+ }
+ synchronized public void setWrappedLine(int line) {
+ fData.setWrappedLine(line);
+ }
}
diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextData.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextData.java
index 9ec0d1c78..268999c5d 100644
--- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextData.java
+++ b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextData.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007, 2014 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
* Contributors:
* Michael Scharf (Wind River) - initial API and implementation
* Martin Oberhuber (Wind River) - [168197] Fix Terminal for CDC-1.1/Foundation-1.1
+ * Anton Leherbauer (Wind River) - [453393] Add support for copying wrapped lines without line break
*******************************************************************************/
package org.eclipse.tm.internal.terminal.model;
@@ -262,4 +263,12 @@ public class TerminalTextData implements ITerminalTextData {
fCursorLine=line;
sendCursorChanged();
}
+
+ public boolean isWrappedLine(int line) {
+ return fData.isWrappedLine(line);
+ }
+
+ public void setWrappedLine(int line) {
+ fData.setWrappedLine(line);
+ }
}
diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataFastScroll.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataFastScroll.java
index 6038241ca..e6101581c 100644
--- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataFastScroll.java
+++ b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataFastScroll.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007-2014 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* Michael Scharf (Wind River) - initial API and implementation
+ * Anton Leherbauer (Wind River) - [453393] Add support for copying wrapped lines without line break
*******************************************************************************/
package org.eclipse.tm.internal.terminal.model;
@@ -246,5 +247,13 @@ public class TerminalTextDataFastScroll implements ITerminalTextData {
public void setCursorLine(int line) {
throw new UnsupportedOperationException();
}
+ public boolean isWrappedLine(int line) {
+ assert (line>=0 && line<fHeight) || throwRuntimeException();
+ return fData.isWrappedLine(getPositionOfLine(line));
+ }
+ public void setWrappedLine(int line) {
+ assert (line>=0 && line<fHeight) || throwRuntimeException();
+ fData.setWrappedLine(getPositionOfLine(line));
+ }
}
diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataSnapshot.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataSnapshot.java
index b24c48b45..d6832bd89 100644
--- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataSnapshot.java
+++ b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataSnapshot.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007-2014 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* Michael Scharf (Wind River) - initial API and implementation
+ * Anton Leherbauer (Wind River) - [453393] Add support for copying wrapped lines without line break
*******************************************************************************/
package org.eclipse.tm.internal.terminal.model;
@@ -294,6 +295,9 @@ class TerminalTextDataSnapshot implements ITerminalTextDataSnapshot {
public ITerminalTextData getTerminalTextData() {
return fTerminal;
}
+ public boolean isWrappedLine(int line) {
+ return fSnapshot.isWrappedLine(line);
+ }
}
diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataStore.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataStore.java
index fd85cc35e..22026e577 100644
--- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataStore.java
+++ b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataStore.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007-2014 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,11 +7,13 @@
*
* Contributors:
* Michael Scharf (Wind River) - initial API and implementation
+ * Anton Leherbauer (Wind River) - [453393] Add support for copying wrapped lines without line break
*******************************************************************************/
package org.eclipse.tm.internal.terminal.model;
import java.lang.reflect.Array;
import java.util.ArrayList;
+import java.util.BitSet;
import java.util.List;
import org.eclipse.tm.terminal.model.ITerminalTextData;
@@ -31,6 +33,8 @@ public class TerminalTextDataStore implements ITerminalTextData {
private int fMaxHeight;
private int fCursorColumn;
private int fCursorLine;
+ final private BitSet fWrappedLines = new BitSet();
+
public TerminalTextDataStore() {
fChars=new char[0][];
fStyle=new Style[0][];
@@ -75,8 +79,7 @@ public class TerminalTextDataStore implements ITerminalTextData {
// clean the new lines
if(height>fHeight) {
for (int i = fHeight; i < height; i++) {
- fStyle[i]=null;
- fChars[i]=null;
+ cleanLine(i);
}
}
// set dimensions after successful resize!
@@ -209,6 +212,7 @@ public class TerminalTextDataStore implements ITerminalTextData {
for (int i = startLine; i < startLine+size+shift; i++) {
fChars[i]=fChars[i-shift];
fStyle[i]=fStyle[i-shift];
+ fWrappedLines.set(i, fWrappedLines.get(i-shift));
}
// then clean the opened lines
cleanLines(Math.max(startLine, startLine+size+shift),Math.min(-shift, getHeight()-startLine));
@@ -217,6 +221,7 @@ public class TerminalTextDataStore implements ITerminalTextData {
for (int i = startLine+size-1; i >=startLine && i-shift>=0; i--) {
fChars[i]=fChars[i-shift];
fStyle[i]=fStyle[i-shift];
+ fWrappedLines.set(i, fWrappedLines.get(i-shift));
}
cleanLines(startLine, Math.min(shift, getHeight()-startLine));
}
@@ -228,8 +233,7 @@ public class TerminalTextDataStore implements ITerminalTextData {
*/
private void cleanLines(int line, int len) {
for (int i = line; i < line+len; i++) {
- fChars[i]=null;
- fStyle[i]=null;
+ cleanLine(i);
}
}
@@ -270,8 +274,7 @@ public class TerminalTextDataStore implements ITerminalTextData {
fStyle=new Style[n][];
}
for (int i = 0; i < n; i++) {
- fChars[i]=source.getChars(i);
- fStyle[i]=source.getStyles(i);
+ copyLine(source, i, i);
}
fHeight=n;
fCursorLine=source.getCursorLine();
@@ -279,14 +282,14 @@ public class TerminalTextDataStore implements ITerminalTextData {
}
public void copyRange(ITerminalTextData source, int sourceStartLine, int destStartLine,int length) {
for (int i = 0; i < length; i++) {
- fChars[i+destStartLine]=source.getChars(i+sourceStartLine);
- fStyle[i+destStartLine]=source.getStyles(i+sourceStartLine);
+ copyLine(source, i+sourceStartLine, i+destStartLine);
}
}
public void copyLine(ITerminalTextData source, int sourceLine, int destLine) {
fChars[destLine]=source.getChars(sourceLine);
fStyle[destLine]=source.getStyles(sourceLine);
+ fWrappedLines.set(destLine, source.isWrappedLine(sourceLine));
}
public char[] getChars(int line) {
@@ -304,6 +307,7 @@ public class TerminalTextDataStore implements ITerminalTextData {
public void setLine(int line, char[] chars, Style[] styles) {
fChars[line]=(char[]) chars.clone();
fStyle[line]=(Style[]) styles.clone();
+ fWrappedLines.clear(line);
}
public void setMaxHeight(int height) {
@@ -317,6 +321,7 @@ public class TerminalTextDataStore implements ITerminalTextData {
public void cleanLine(int line) {
fChars[line]=null;
fStyle[line]=null;
+ fWrappedLines.clear(line);
}
public int getCursorColumn() {
return fCursorColumn;
@@ -330,4 +335,10 @@ public class TerminalTextDataStore implements ITerminalTextData {
public void setCursorLine(int line) {
fCursorLine=line;
}
+ public boolean isWrappedLine(int line) {
+ return fWrappedLines.get(line);
+ }
+ public void setWrappedLine(int line) {
+ fWrappedLines.set(line);
+ }
}
diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataWindow.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataWindow.java
index 583318a18..ce2f10373 100644
--- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataWindow.java
+++ b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/model/TerminalTextDataWindow.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007-2014 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* Michael Scharf (Wind River) - initial API and implementation
+ * Anton Leherbauer (Wind River) - [453393] Add support for copying wrapped lines without line break
*******************************************************************************/
package org.eclipse.tm.internal.terminal.model;
@@ -194,4 +195,13 @@ public class TerminalTextDataWindow implements ITerminalTextData {
public void setCursorLine(int line) {
fData.setCursorLine(line);
}
+ public boolean isWrappedLine(int line) {
+ if(isInWindow(line))
+ return fData.isWrappedLine(line - fWindowStartLine);
+ return false;
+ }
+ public void setWrappedLine(int line) {
+ if(isInWindow(line))
+ fData.setWrappedLine(line - fWindowStartLine);
+ }
}
diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/AbstractTextCanvasModel.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/AbstractTextCanvasModel.java
index 770db9733..1d63b3ae9 100644
--- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/AbstractTextCanvasModel.java
+++ b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/textcanvas/AbstractTextCanvasModel.java
@@ -309,7 +309,7 @@ abstract public class AbstractTextCanvasModel implements ITextCanvasModel {
text=""; //$NON-NLS-1$
}
buffer.append(text);
- if(line < fSeletionEndLine)
+ if(line < fSeletionEndLine && !fSelectionSnapshot.getTerminalTextData().isWrappedLine(line))
buffer.append('\n');
}
return buffer.toString();
diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextData.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextData.java
index 3ca18158a..da4881338 100644
--- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextData.java
+++ b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextData.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007, 2014 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
* Contributors:
* Michael Scharf (Wind River) - initial API and implementation
* Martin Oberhuber (Wind River) - [261486][api][cleanup] Mark @noimplement interfaces as @noextend
+ * Anton Leherbauer (Wind River) - [453393] Add support for copying wrapped lines without line break
*******************************************************************************/
package org.eclipse.tm.terminal.model;
@@ -71,20 +72,6 @@ public interface ITerminalTextData extends ITerminalTextDataReadOnly {
* @param line
*/
void cleanLine(int line);
- // /**
- // * @param line
- // * @return true if this line belongs to the previous line but is simply
- // * wrapped.
- // */
- // boolean isWrappedLine(int line);
- //
- // /**
- // * Makes this line an extension to the previous line. Wrapped lines get folded back
- // * when the width of the terminal changes
- // * @param line
- // * @param extendsPreviousLine
- // */
- // void setWrappedLine(int line, boolean extendsPreviousLine);
/**
* Shifts some lines up or down. The "empty" space is filled with <code>'\000'</code> chars
@@ -151,4 +138,13 @@ public interface ITerminalTextData extends ITerminalTextDataReadOnly {
void setCursorLine(int line);
void setCursorColumn(int column);
+
+ /**
+ * Makes this line a wrapped line which logically continues on next line.
+ *
+ * @param line
+ * @since 3.3
+ */
+ void setWrappedLine(int line);
+
}
diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextDataReadOnly.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextDataReadOnly.java
index 0503b4c1d..876ac102b 100644
--- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextDataReadOnly.java
+++ b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextDataReadOnly.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007, 2014 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
* Contributors:
* Michael Scharf (Wind River) - initial API and implementation
* Martin Oberhuber (Wind River) - [261486][api][cleanup] Mark @noimplement interfaces as @noextend
+ * Anton Leherbauer (Wind River) - [453393] Add support for copying wrapped lines without line break
*******************************************************************************/
package org.eclipse.tm.terminal.model;
@@ -73,4 +74,12 @@ public interface ITerminalTextDataReadOnly {
* @return the column at which the cursor is at the moment
*/
int getCursorColumn();
-} \ No newline at end of file
+
+ /**
+ * @param line
+ * @return true if this line got wrapped, ie. logically continues on next line
+ * @since 3.3
+ */
+ boolean isWrappedLine(int line);
+
+}

Back to the top