From 1b7a4139e7c4becc27e3669f4f3b8df7883d79d2 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Mon, 1 Feb 2021 14:15:52 -0800 Subject: [PATCH] Select line on empty selection for Comment/Uncomment Selection --- IDE/src/ui/SourceEditWidgetContent.bf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/IDE/src/ui/SourceEditWidgetContent.bf b/IDE/src/ui/SourceEditWidgetContent.bf index 1b78704b..540c766f 100644 --- a/IDE/src/ui/SourceEditWidgetContent.bf +++ b/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;