From f45938cc20ed6992e5215ffe41b73b528c78be9c Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <Bram@vim.org>
Date: Thu, 2 Nov 2017 15:59:57 +0100
Subject: [PATCH] patch 8.0.1243: no test for what 8.0.1227 fixes

Problem:    No test for what 8.0.1227 fixes.
Solution:   Add a test that triggers the problem. (Christian Brabandt)
---
 src/testdir/test_normal.vim |  7 +++++++
 src/testdir/test_search.vim | 15 +++++++++++++++
 src/version.c               |  2 ++
 3 files changed, 24 insertions(+)

diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim
index f6b1a43b8..90033c08e 100644
--- a/src/testdir/test_normal.vim
+++ b/src/testdir/test_normal.vim
@@ -1208,6 +1208,13 @@ func! Test_normal19_z_spell()
   call assert_match("Word 'goood' added to ./Xspellfile2.add", a)
   call assert_equal('goood', cnt[0])
 
+  " Test for :spellgood!
+  let temp = execute(':spe!0/0')
+  call assert_match('Invalid region', temp)
+  let spellfile = matchstr(temp, 'Invalid region nr in \zs.*\ze line \d: 0')
+  call assert_equal(['# goood', '# goood/!', '#oood', '0/0'], readfile(spellfile))
+  call delete(spellfile)
+
   " clean up
   exe "lang" oldlang
   call delete("./Xspellfile.add")
diff --git a/src/testdir/test_search.vim b/src/testdir/test_search.vim
index b863fcbba..8d68f0c05 100644
--- a/src/testdir/test_search.vim
+++ b/src/testdir/test_search.vim
@@ -567,3 +567,18 @@ func Test_search_cmdline_incsearch_highlight_attr()
 
   bwipe!
 endfunc
+
+func Test_search_undefined_behaviour()
+  if !has("terminal")
+    return
+  endif
+  let h = winheight(0)
+  if h < 3
+    return
+  endif
+  " did cause an undefined left shift
+  let g:buf = term_start([GetVimProg(), '--clean', '-e', '-s', '-c', 'call search(getline("."))', 'samples/test000'], {'term_rows': 3})
+  call assert_equal([''], getline(1, '$'))
+  call term_sendkeys(g:buf, ":qa!\<cr>")
+  bwipe!
+endfunc
diff --git a/src/version.c b/src/version.c
index 61e8ea2d0..83bfd7063 100644
--- a/src/version.c
+++ b/src/version.c
@@ -761,6 +761,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1243,
 /**/
     1242,
 /**/
-- 
2.40.0