Only use first line of primary selection when populating FindInFiles bar

For #8211
@peterflynn I tend to introduce a more generic function, like `StringUtils.getFirstLine()`. Is that ok with you?