patch 8.1.2348: :const cannot be followed by "| endif"

Problem:    :const cannot be followed by "| endif".
Solution:   Check following command for :const. (closes #5269)
            Also fix completion after :const.
diff --git a/src/testdir/test_const.vim b/src/testdir/test_const.vim
index 55e4492..8df34f4 100644
--- a/src/testdir/test_const.vim
+++ b/src/testdir/test_const.vim
@@ -197,6 +197,12 @@
     call assert_fails('const [i2, f2, s2] = [1, 1.1, "vim"]', 'E995:')
 endfunc
 
+func Test_const_with_condition()
+  const x = 0
+  if 0 | const x = 1 | endif
+  call assert_equal(0, x)
+endfunc
+
 func Test_const_with_index_access()
     let l = [1, 2, 3]
     call assert_fails('const l[0] = 4', 'E996:')