I see this behavior, too, and I did a screen recording (attached).
I had the search mini window open with a search keyword matching the current line (yellow marking). Then I edited the comment above the matching line and then marked the line below the comment. As as a result, the line unselects itself. After pressing undo the selection within the comment unselects itself, too.
If I close the search mini window, the unselect is not happening.
Emulation: CUA
OS Version: Ubuntu 16.04.3 LTS
Processor Architecture: x86_64
Language: . (Bourne Shell)
Encoding: Automatic
Kind regards
Exo