--- a/src/Tools/jEdit/src/isabelle.scala Fri Jun 23 11:55:33 2017 +0200
+++ b/src/Tools/jEdit/src/isabelle.scala Fri Jun 23 14:21:16 2017 +0200
@@ -263,8 +263,8 @@
val caret = text_area.getCaretPosition
val (toks1, toks2) = Text_Structure.split_line_content(buffer, keywords, line, caret)
- if (toks1.nonEmpty && keywords.is_indent_command(toks1.head))
- buffer.indentLine(line, true)
+ if (toks1.isEmpty) buffer.removeTrailingWhiteSpace(Array(line))
+ else if (keywords.is_indent_command(toks1.head)) buffer.indentLine(line, true)
if (toks2.isEmpty || keywords.is_indent_command(toks2.head))
JEdit_Lib.buffer_edit(buffer) {