Explorar o código

Select line on empty selection for Comment/Uncomment Selection

Brian Fiete %!s(int64=4) %!d(string=hai) anos
pai
achega
1b7a4139e7
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      IDE/src/ui/SourceEditWidgetContent.bf

+ 8 - 0
IDE/src/ui/SourceEditWidgetContent.bf

@@ -2162,6 +2162,14 @@ namespace IDE.ui
 			if (CheckReadOnly())
 				return false;
 
+			if ((!HasSelection()) && (doComment != null))
+			{
+				CursorToLineEnd();
+				int cursorEndPos = CursorTextPos;
+				CursorToLineStart(false);
+				mSelection = .(CursorTextPos, cursorEndPos);
+			}
+
 		    if ((HasSelection()) && (mSelection.Value.Length > 1))
 		    {
 				var startLineAndCol = CursorLineAndColumn;