View | Details | Raw Unified | Return to bug 263458
Collapse All | Expand All

(-)src/org/eclipse/wst/jsdt/internal/ui/text/java/JavaAutoIndentStrategy.java (-17 / +21 lines)
Lines 1194-1220 Link Here
1194
	 * @see org.eclipse.jface.text.IAutoIndentStrategy#customizeDocumentCommand(org.eclipse.jface.text.IDocument, org.eclipse.jface.text.DocumentCommand)
1194
	 * @see org.eclipse.jface.text.IAutoIndentStrategy#customizeDocumentCommand(org.eclipse.jface.text.IDocument, org.eclipse.jface.text.DocumentCommand)
1195
	 */
1195
	 */
1196
	public void customizeDocumentCommand(IDocument d, DocumentCommand c) {
1196
	public void customizeDocumentCommand(IDocument d, DocumentCommand c) {
1197
		if (c.doit == false)
1197
		try {
1198
			if (c.doit == false)
1198
			return;
1199
			return;
1199
1200
1200
		clearCachedValues();
1201
			clearCachedValues();
1201
1202
	
1202
		if (!fIsSmartMode) {
1203
			if (!fIsSmartMode) {
1203
			super.customizeDocumentCommand(d, c);
1204
				super.customizeDocumentCommand(d, c);
1204
			return;
1205
				return;
1206
			}
1207
	
1208
			if (!fIsSmartTab && isRepresentingTab(c.text))
1209
				return;
1210
	
1211
			if (c.length == 0 && c.text != null && isLineDelimiter(d, c.text))
1212
				smartIndentAfterNewLine(d, c);
1213
			else if (c.text.length() == 1)
1214
				smartIndentOnKeypress(d, c);
1215
			else if (c.text.length() > 1 && getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_SMART_PASTE))
1216
				if (fViewer == null || fViewer.getTextWidget() == null || !fViewer.getTextWidget().getBlockSelection())
1217
					smartPaste(d, c); // no smart backspace for paste
1218
		} catch(IllegalArgumentException e) {
1219
			// ignore
1205
		}
1220
		}
1206
1221
1207
		if (!fIsSmartTab && isRepresentingTab(c.text))
1208
			return;
1209
1210
		if (c.length == 0 && c.text != null && isLineDelimiter(d, c.text))
1211
			smartIndentAfterNewLine(d, c);
1212
		else if (c.text.length() == 1)
1213
			smartIndentOnKeypress(d, c);
1214
		else if (c.text.length() > 1 && getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_SMART_PASTE))
1215
			if (fViewer == null || fViewer.getTextWidget() == null || !fViewer.getTextWidget().getBlockSelection())
1216
				smartPaste(d, c); // no smart backspace for paste
1217
1218
	}
1222
	}
1219
1223
1220
	/**
1224
	/**

Return to bug 263458