浏览代码

Select line on empty selection for Comment/Uncomment Selection

Brian Fiete 4 年之前
父节点
当前提交
1b7a4139e7
共有 1 个文件被更改,包括 8 次插入0 次删除
  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;