patch 9.0.0185: virtual text does not show if text prop at same position

Problem:    Virtual text does not show if tehre is a text prop at same
            position. (Ben Jackson)
Solution:   Fix the sorting of properties. (closes #10879)
diff --git a/src/testdir/dumps/Test_prop_at_same_pos.dump b/src/testdir/dumps/Test_prop_at_same_pos.dump
new file mode 100644
index 0000000..95f01fa
--- /dev/null
+++ b/src/testdir/dumps/Test_prop_at_same_pos.dump
@@ -0,0 +1,5 @@
+>f+0&#ffffff0|u|n|c|t|i|o|n|(| |o+0#ffffff16#ff404010|n|e|:| |c+0#0000000#ffff4012|a|l@1|,+0&#ffffff0| |t+0#00e0e07&|w|o|:| |a+0#0000000#ffff4012|r|g|u|m|e|n|t|,+0&#ffffff0| |t+0&#ffd7ff255|h|r|e@1|:| |h+0&#ffff4012|e|r|e| +0&#ffffff0|)| @25
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+| +0#0000000&@56|1|,|1| @10|A|l@1| 
diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim
index 8533af3..29cd599 100644
--- a/src/testdir/test_textprop.vim
+++ b/src/testdir/test_textprop.vim
@@ -1334,6 +1334,33 @@
   call delete('XtestNowrap')
 endfunc
 
+func Test_textprop_text_priority()
+  CheckScreendump
+
+  let lines =<< trim END
+      call setline(1, "function( call, argument, here )")
+
+      call prop_type_add('one', #{highlight: 'Error'})
+      call prop_type_add('two', #{highlight: 'Function'})
+      call prop_type_add('three', #{highlight: 'DiffChange'})
+      call prop_type_add('arg', #{highlight: 'Search'})
+
+      call prop_add(1, 27, #{type: 'arg', length: len('here')})
+      call prop_add(1, 27, #{type: 'three', text: 'three: '})
+      call prop_add(1, 11, #{type: 'one', text: 'one: '})
+      call prop_add(1, 11, #{type: 'arg', length: len('call')})
+      call prop_add(1, 17, #{type: 'two', text: 'two: '})
+      call prop_add(1, 17, #{type: 'arg', length: len('argument')})
+  END
+  call writefile(lines, 'XtestPropPrio')
+  let buf = RunVimInTerminal('-S XtestPropPrio', {'rows': 5})
+  call VerifyScreenDump(buf, 'Test_prop_at_same_pos', {})
+
+  " clean up
+  call StopVimInTerminal(buf)
+  call delete('XtestPropPrio')
+endfunc
+
 func Test_textprop_with_syntax()
   CheckScreendump