Add Initializer Quick-Fix: Place caret at the end of generated initializer

#KT-10704 Fixed
This commit is contained in:
Alexey Sedunov
2016-01-19 11:43:19 +03:00
parent 9081f5df52
commit 8da986ff24
7 changed files with 7 additions and 6 deletions
@@ -61,6 +61,7 @@ object InitializePropertyQuickFixFactory : KotlinIntentionActionsFactory() {
if (editor != null) {
PsiDocumentManager.getInstance(project).commitDocument(editor.document)
editor.selectionModel.setSelection(initializer.startOffset, initializer.endOffset)
editor.caretModel.moveToOffset(initializer.endOffset)
}
}
}
@@ -1,4 +1,4 @@
// "Add initializer" "true"
class A {
<caret>val n: Int = <selection>0</selection>
val n: Int = <selection>0</selection><caret>
}
@@ -1,5 +1,5 @@
// "Add initializer" "true"
class A {
var n: Int = <selection>0</selection>
var n: Int = <selection>0</selection><caret>
get() = 1
}
@@ -1,5 +1,5 @@
// "Add initializer" "true"
class A {
var n: Int = <selection>0</selection>
var n: Int = <selection>0</selection><caret>
set(value: Int) {}
}
@@ -1,2 +1,2 @@
// "Add initializer" "true"
<caret>val n: Int = <selection>0</selection>
val n: Int = <selection>0</selection><caret>
@@ -1,3 +1,3 @@
// "Add initializer" "true"
<caret>var n: Int = <selection>0</selection>
var n: Int = <selection>0</selection><caret>
get() = 1
@@ -1,3 +1,3 @@
// "Add initializer" "true"
<caret>var n: Int = <selection>0</selection>
var n: Int = <selection>0</selection><caret>
set(value: Int) {}