#!/bin/sh
# -*- tcl -*-
# The next line is executed by /bin/sh, but not tcl \
exec tclsh "$0" ${1+"$@"}

# Test for `x or `` restoring the cursor position within the line
#
# Was https://github.com/martinwguy/xvi/issues/150

source scripts/term
start_vi

# Make sure setting a mark and going there with `
# restores the position within the line.
test 10 "aabcde\rfghij[esc]1Gll" 1 2 [list "abcde" "fghij"]	;# On the c
test 11 "mmG"			 2 0 [list "abcde" "fghij"]
test 12 "`m"			 1 2 [list "abcde" "fghij"]

# The same thing using the previous context mark
test 21 "G"			 2 0 [list "abcde" "fghij"]
test 22 "``"			 1 2 [list "abcde" "fghij"]

stop_vi

exit 0
