Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

spaces for tabs in partitioned editors

  • Loading branch information...
commit 6caec8f7918e1346e2428747b8884d8480a3d988 1 parent 4d9b385
@JPMoresmau authored
View
1  docs/releasenotes/net.sf.eclipsefp.haskell_2.5.2.txt
@@ -18,6 +18,7 @@ Fixes:
Features:
- Rebuild executables if workspace is autobuilding when dependent project is rebuilt (https://github.com/JPMoresmau/eclipsefp/issues/94)
- Limit on failures due to configure issues on mismatched cabal (https://github.com/JPMoresmau/eclipsefp/issues/91)
+ - Alex/Happy/UUagc editors use spaces for tabs
Internal:
View
15 ...eclipsefp/haskell/ui/internal/editors/partitioned/PartitionSourceViewerConfiguration.java
@@ -10,9 +10,13 @@
import net.sf.eclipsefp.haskell.core.codeassist.ITokenTypes;
import net.sf.eclipsefp.haskell.ui.HaskellUIPlugin;
import net.sf.eclipsefp.haskell.ui.internal.editors.haskell.text.AnnotationHover;
+import net.sf.eclipsefp.haskell.ui.internal.editors.haskell.text.HaskellAutoIndentStrategy;
import net.sf.eclipsefp.haskell.ui.internal.editors.haskell.text.ScannerManager;
import net.sf.eclipsefp.haskell.ui.internal.preferences.editor.IEditorPreferenceNames;
import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.DefaultLineTracker;
+import org.eclipse.jface.text.IAutoEditStrategy;
+import org.eclipse.jface.text.TabsToSpacesConverter;
import org.eclipse.jface.text.rules.IToken;
import org.eclipse.jface.text.rules.WordRule;
import org.eclipse.jface.text.source.IAnnotationHover;
@@ -152,4 +156,15 @@ public IAnnotationHover getAnnotationHover( final ISourceViewer sourceViewer ) {
return new AnnotationHover();
}
+ @Override
+ public IAutoEditStrategy[] getAutoEditStrategies( final ISourceViewer sv, final String contentType ) {
+ final TabsToSpacesConverter tabConverter = new TabsToSpacesConverter();
+ tabConverter.setLineTracker( new DefaultLineTracker() );
+ tabConverter.setNumberOfSpacesPerTab( getTabWidth( sv ) );
+ return new IAutoEditStrategy[] {
+ new HaskellAutoIndentStrategy(), // is Haskell strategy ok? Probably...
+ tabConverter // convert tabs to spaces too!
+ };
+ }
+
}
Please sign in to comment.
Something went wrong with that request. Please try again.