Skip to content

Commit

Permalink
Use static inner method
Browse files Browse the repository at this point in the history
  • Loading branch information
psyGamer committed Aug 26, 2024
1 parent 73e8999 commit 90c44d8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Studio/CelesteStudio/Editing/Editor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2703,6 +2703,7 @@ protected override void OnMouseDoubleClick(MouseEventArgs e) {
var position = Document.Caret;
string line = Document.Lines[position.Row];

// Select clicked word
int startIdx = position.Col;
int endIdx = position.Col;
while (startIdx > 0 && ShouldExpand(line[startIdx-1])) {
Expand All @@ -2719,9 +2720,7 @@ protected override void OnMouseDoubleClick(MouseEventArgs e) {
Recalc();
return;

bool ShouldExpand(char c) {
return !char.IsWhiteSpace(c) && (!char.IsPunctuation(c) || c is '*' or '_');
}
static bool ShouldExpand(char c) => !char.IsWhiteSpace(c) && (!char.IsPunctuation(c) || c is '*' or '_');
}


Expand Down

0 comments on commit 90c44d8

Please sign in to comment.