[Viplugin-devel] Patch to fix enter
Brought to you by:
midramas
|
From: Ken C. <ke...@co...> - 2003-11-29 03:15:10
|
I made a small modification to get enter to work correctly. I'm aware that
this might be a redundant effort, but I use enter constantly, so this was
really bugging me. I followed the command pattern used with the other
motion commands so this should be easy to drop in.
I might be able to do some of the JUnits after the holidays when I've had
time to get more familiar with the code and plugin coding in general. I
don't want to commit to anything just yet, though.
Ken Collins
Index: .classpath
===================================================================
retrieving revision 1.19
diff -u -r1.19 .classpath
--- .classpath 26 Nov 2003 16:50:35 -0000 1.19
+++ .classpath 29 Nov 2003 03:00:04 -0000
@@ -1,7 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.ui.ide_3.0.0/idesrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.ui.ide_3.0.0/ide.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.ui.views_3.0.0/viewssrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.ui.views_3.0.0/views.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.jface.text_3.0.0/jfacetextsrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.jface.text_3.0.0/jfacetext.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.text_3.0.0/textsrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.text_3.0.0/text.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.ui.workbench.texteditor_3.0.0/texteditorsrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.ui.workbench.texteditor_3.0.0/texteditor.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.ui.editors_3.0.0/editorssrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.ui.editors_3.0.0/editors.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.core.resources_3.0.0/resourcessrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.core.resources_3.0.0/resources.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_JDT_SOURCE_SRC/org.junit_3.8.1/junitsrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.junit_3.8.1/junit.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.ui.workbench_3.0.0/workbenchsrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.ui.workbench_3.0.0/workbench.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.ui_3.0.0/uisrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.ui_3.0.0/ui.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_LINUX_GTK_X86_SRC/org.eclipse.swt.gtk_3.0.0/ws/gtk/swtsrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.swt.gtk_3.0.0/ws/gtk/swt.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_LINUX_GTK_X86_SRC/org.eclipse.swt.gtk_3.0.0/ws/gtk/swt-pisrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.swt.gtk_3.0.0/ws/gtk/swt-pi.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_LINUX_GTK_X86_SRC/org.eclipse.swt.gtk_3.0.0/ws/gtk/swt-mozillasrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.swt.gtk_3.0.0/ws/gtk/swt-mozilla.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.jface_3.0.0/jfacesrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.jface_3.0.0/jface.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.core.boot_3.0.0/bootsrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.core.boot_3.0.0/boot.jar"/>
+ <classpathentry sourcepath="ORG_ECLIPSE_PLATFORM_SOURCE_SRC/org.eclipse.core.runtime_3.0.0/runtimesrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.core.runtime_3.0.0/runtime.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Index: src/viPlugin/commands/motion/EnterCommand.java
===================================================================
retrieving revision 1.3
diff -u -r1.3 EnterCommand.java
--- src/viPlugin/commands/motion/EnterCommand.java 25 Nov 2003 17:25:47 -0000 1.3
+++ src/viPlugin/commands/motion/EnterCommand.java 29 Nov 2003 03:00:07 -0000
@@ -21,7 +21,7 @@
public void execute() {
Command command = new MoveDown(_counter);
command.execute();
- command = new MoveToLineBegin();
+ command = new MoveToFirstChar();
command.execute();
}
}
Index: src/viPlugin/commands/motion/MoveToFirstChar.java
===================================================================
RCS file: src/viPlugin/commands/motion/MoveToFirstChar.java
diff -N src/viPlugin/commands/motion/MoveToFirstChar.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/viPlugin/commands/motion/MoveToFirstChar.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,25 @@
+package viPlugin.commands.motion;
+
+import viPlugin.TextModificator;
+
+/**
+ * Moves to the first non-blank character in a line.
+ *
+ * @author <a href="mailto:ke...@co...">Ken Collins</a>
+ * @version $Revision:$ $Date:$
+ */
+public class MoveToFirstChar extends MotionCommand {
+
+ public MoveToFirstChar() {
+ super(1);
+ }
+
+ /* (non-Javadoc)
+ * @see viPlugin.commands.Command#execute()
+ */
+ public void execute() {
+ TextModificator tm = TextModificator.getInstance();
+ tm.cursorToLineFirstNonBlank();
+ }
+
+}
|