patch 9.1.0907: printoptions:portrait does not change postscript Orientation

Problem:  printoptions:portrait does not change postscript Orientation
Solution: Set Orientation depending on portrait suboption.

fixes: #16156
closes: #16174

Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/test_hardcopy.vim b/src/testdir/test_hardcopy.vim
index be83728..926ff8f 100644
--- a/src/testdir/test_hardcopy.vim
+++ b/src/testdir/test_hardcopy.vim
@@ -209,4 +209,31 @@
   call delete('Xpstest')
 endfunc
 
+func Test_printoptions_portrait()
+  CheckFeature postscript
+  edit test_hardcopy.vim
+  syn on
+
+  set printoptions=portrait:y
+  1,50hardcopy > Xhardcopy_printoptions_portrait
+  let lines = readfile('Xhardcopy_printoptions_portrait')
+  call assert_match('Orientation: Portrait', lines[6])
+  call assert_match('BoundingBox: 59 49 564 800', lines[9])
+  call assert_match('DocumentMedia: A4', lines[10])
+  call assert_match('PageMedia: A4', lines[24])
+  call delete('Xhardcopy_printoptions')
+
+  set printoptions=portrait:n
+  1,50hardcopy > Xhardcopy_printoptions_portrait
+  let lines = readfile('Xhardcopy_printoptions_portrait')
+  call assert_match('Orientation: Landscape', lines[6])
+  call assert_match('BoundingBox: 59 42 590 756', lines[9])
+  call assert_match('DocumentMedia: A4', lines[10])
+  call assert_match('PageMedia: A4', lines[24])
+  call delete('Xhardcopy_printoptions')
+
+  set printoptions&
+  bwipe
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab