Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

1fun findIndex(items: List<String>, target: String): Int {
2 for (i in 0 until items.size) {
3 if (items[i] == target) {
4 return i
5 }
6 }
7 return -1
8}
…lines 9–15 unchanged (7 lines)

After

1fun findIndex(items: List<String>, target: String): Int {
2 for (i in 0..items.size) {
3 if (items[i] == target) {
4 return i
5 }
6 }
7 return -1
8}
…lines 9–15 unchanged (7 lines)

Before

source_file
function_declaration
fun "fun"
identifier "findIndex"
function_value_parameters
( "("
parameter
identifier "items"
: ":"
user_type
identifier "List"
type_arguments
< "<"
type_projection
user_type
identifier "String"
> ">"
, ","
parameter
identifier "target"
: ":"
user_type
identifier "String"
) ")"
: ":"
user_type
identifier "Int"
function_body
block
{ "{"
for_statement
for "for"
( "("
variable_declaration
identifier "i"
in "in"
infix_expression
number_literal "0"
identifier "until"
navigation_expression
identifier "items"
. "."
identifier "size"
) ")"
block (+21 nodes collapsed)
return_expression
return "return"
unary_expression
- "-"
number_literal "1"
} "}"
function_declaration (+62 nodes collapsed)

After

source_file
function_declaration
fun "fun"
identifier "findIndex"
function_value_parameters
( "("
parameter
identifier "items"
: ":"
user_type
identifier "List"
type_arguments
< "<"
type_projection
user_type
identifier "String"
> ">"
, ","
parameter
identifier "target"
: ":"
user_type
identifier "String"
) ")"
: ":"
user_type
identifier "Int"
function_body
block
{ "{"
for_statement
for "for"
( "("
variable_declaration
identifier "i"
in "in"
range_expression
number_literal "0"
.. ".."
navigation_expression
identifier "items"
. "."
identifier "size"
) ")"
block (+21 nodes collapsed)
return_expression
return "return"
unary_expression
- "-"
number_literal "1"
} "}"
function_declaration (+62 nodes collapsed)