patch 8.1.1475: search string not displayed when 'rightleft' is set

Problem:    Search string not displayed when 'rightleft' is set.
Solution:   Clear the right part of the old text. (closes #4488, closes #4489)
diff --git a/src/testdir/test_search.vim b/src/testdir/test_search.vim
index d59f39d..8090dee 100644
--- a/src/testdir/test_search.vim
+++ b/src/testdir/test_search.vim
@@ -1289,3 +1289,25 @@
 
   close!
 endfunc
+
+func Test_search_display_pattern()
+  new
+  call setline(1, ['foo', 'bar', 'foobar'])
+
+  call cursor(1, 1)
+  let @/ = 'foo'
+  let pat = escape(@/, '()*?'. '\s\+')
+  let g:a = execute(':unsilent :norm! n')
+  call assert_match(pat, g:a)
+
+  " right-left
+  if exists("+rightleft")
+    set rl
+    call cursor(1, 1)
+    let @/ = 'foo'
+    let pat = 'oof/\s\+'
+    let g:a = execute(':unsilent :norm! n')
+    call assert_match(pat, g:a)
+    set norl
+  endif
+endfunc