From 640a20c9610851f98f38ee237fc153f9221f52e1 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Tue, 13 Oct 2020 08:01:28 -0700 Subject: [PATCH] Made Home/End go to extents of symbol being renamed --- IDE/src/ui/SourceEditWidgetContent.bf | 35 +++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/IDE/src/ui/SourceEditWidgetContent.bf b/IDE/src/ui/SourceEditWidgetContent.bf index 837958b4..f4b678f4 100644 --- a/IDE/src/ui/SourceEditWidgetContent.bf +++ b/IDE/src/ui/SourceEditWidgetContent.bf @@ -3440,6 +3440,41 @@ namespace IDE.ui return; } + if (mSourceViewPanel?.mRenameSymbolDialog?.mKind == .Rename) + { + int wantCursorPos = -1; + + if (keyCode == .Home) + { + int checkPos = CursorTextPos - 1; + while (checkPos >= 0) + { + if (mData.mText[checkPos].mDisplayFlags & (uint8)SourceElementFlags.SymbolReference == 0) + break; + wantCursorPos = checkPos; + checkPos--; + } + } + else if (keyCode == .End) + { + int checkPos = CursorTextPos; + while (checkPos < mData.mTextLength) + { + if (mData.mText[checkPos].mDisplayFlags & (uint8)SourceElementFlags.SymbolReference == 0) + break; + checkPos++; + wantCursorPos = checkPos; + } + } + + if (wantCursorPos != -1) + { + mSelection = null; + CursorTextPos = wantCursorPos; + return; + } + } + //var lineAndColumn = CursorLineAndColumn; int prevCursorPos;