Pārlūkot izejas kodu

Select line on empty selection for Comment/Uncomment Selection

Brian Fiete 4 gadi atpakaļ
vecāks
revīzija
1b7a4139e7
1 mainītis faili ar 8 papildinājumiem un 0 dzēšanām
  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;