Better caret position after Insert curly braces around variable (KT-28739)

Introduce helper class and move caret to it's original position.

 #KT-28739 Fixed
This commit is contained in:
Nikolay Krasko
2018-12-10 18:15:25 +03:00
parent 44a36e70ec
commit 5fb90a8a81
11 changed files with 97 additions and 7 deletions
@@ -1,5 +1,5 @@
// IS_APPLICABLE: true
fun foo() {
val x = 4
val y = "${x}"
val y = "${<caret>x}"
}
@@ -1,5 +1,5 @@
// IS_APPLICABLE: true
fun foo() {
val x = 4
val y = "something${x}.somethingelse"
val y = "something${<caret>x}.somethingelse"
}
@@ -1,5 +1,5 @@
// IS_APPLICABLE: true
fun foo() {
val x = 4
val y = "$x${x}$x"
val y = "$x${<caret>x}$x"
}
@@ -1,5 +1,5 @@
// IS_APPLICABLE: true
fun foo() {
val x = 4
val y = """$x${x}$x"""
val y = """$x${<caret>x}$x"""
}
@@ -0,0 +1,2 @@
val test = "some"
val other = "text $test<caret> text"
@@ -0,0 +1,2 @@
val test = "some"
val other = "text ${test<caret>} text"
@@ -0,0 +1,2 @@
val test = "some"
val other = "text $te<caret>st text"
@@ -0,0 +1,2 @@
val test = "some"
val other = "text ${te<caret>st} text"