提交 2661f72d 编写于 作者: D Dustin Campbell

Code review feedback for PR #5494

上级 d1220cb7
......@@ -482,7 +482,7 @@ public void ExecuteCommand(ReturnKeyCommandArgs args, Action nextHandler)
// Check to see if the current line starts with exterior trivia. If so, we'll take over.
// If not, let the nextHandler run.
int originalPosition;
int originalPosition = -1;
// The original position should be a position that is consistent with the syntax tree, even
// after Enter is pressed. Thus, we use the start of the first selection if there is one.
......@@ -495,12 +495,8 @@ public void ExecuteCommand(ReturnKeyCommandArgs args, Action nextHandler)
.FirstOrNullable();
originalPosition = selectedSpan != null
? args.TextView.BufferGraph.MapUpOrDownToBuffer(selectedSpan.Value.Start, args.SubjectBuffer) ?? -1
: (args.TextView.GetCaretPoint(args.SubjectBuffer) ?? -1);
}
else
{
originalPosition = args.TextView.GetCaretPoint(args.SubjectBuffer) ?? -1;
? selectedSpan.Value.Start
: args.TextView.GetCaretPoint(args.SubjectBuffer) ?? -1;
}
if (originalPosition < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册