Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(522)

Unified Diff: pkg/analysis_server/lib/src/services/correction/assist_internal.dart

Issue 2892963002: Fix reparent on windows (Closed)
Patch Set: Added a test Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/correction/assist_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/services/correction/assist_internal.dart
diff --git a/pkg/analysis_server/lib/src/services/correction/assist_internal.dart b/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
index adfcbd6755a6725bc8b05c337f823bcfe22a3445..e706a77135a47d10bbbf5f7ec0681645ab682d16 100644
--- a/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
@@ -1772,10 +1772,12 @@ class AssistProcessor {
sb.append('(');
if (newExprSrc.contains(eol)) {
int newlineIdx = newExprSrc.lastIndexOf(eol);
- if (newlineIdx == newExprSrc.length - 1) {
- newlineIdx -= 1;
+ int eolLen = eol.length;
+ if (newlineIdx == newExprSrc.length - eolLen) {
+ newlineIdx -= eolLen;
}
- String indentOld = utils.getLinePrefix(newExpr.offset + 1 + newlineIdx);
+ String indentOld =
+ utils.getLinePrefix(newExpr.offset + eolLen + newlineIdx);
String indentNew = '$indentOld${utils.getIndent(1)}';
sb.append(eol);
sb.append(indentNew);
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/correction/assist_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698