diff --git a/pythonx/UltiSnips/_vim.py b/pythonx/UltiSnips/_vim.py index 0aae5a7..568da3a 100644 --- a/pythonx/UltiSnips/_vim.py +++ b/pythonx/UltiSnips/_vim.py @@ -43,11 +43,8 @@ class VimBuffer(object): @property def line_till_cursor(self): # pylint:disable=no-self-use """Returns the text before the cursor.""" - # Note: we want byte position here - _, col = vim.current.window.cursor - line = vim.current.line - before = as_unicode(line[:col]) - return before + _, col = self.cursor + return as_unicode(vim.current.line)[:col] @property def number(self): # pylint:disable=no-self-use diff --git a/test/test_Chars.py b/test/test_Chars.py index 9a2f8e6..93d81ba 100644 --- a/test/test_Chars.py +++ b/test/test_Chars.py @@ -240,4 +240,15 @@ class Snippet_With_Umlauts_Python(_UmlautsBase): snippets = ('ül', 'üü ${1:world} üü `!p snip.rv = len(t[1])*"a"`') keys = 'te ül' + EX + 'hüüll' wanted = 'te üü hüüll üü aaaaa' + +class UmlautsBeforeTriggerAndCharsAfter(_UmlautsBase): + snippets = ('trig', 'success') + keys = 'ööuu trig b' + 2 * ARR_L + EX + wanted = 'ööuu success b' + +class NoUmlautsBeforeTriggerAndCharsAfter(_UmlautsBase): + snippets = ('trig', 'success') + keys = 'oouu trig b' + 2 * ARR_L + EX + wanted = 'oouu success b' + # End: Umlauts and Special Chars #}}} diff --git a/travis_test.sh b/travis_test.sh index 4dccae9..1a6a24a 100755 --- a/travis_test.sh +++ b/travis_test.sh @@ -16,22 +16,14 @@ elif [[ $VIM_VERSION == "NEOVIM" ]]; then VIM="$(which nvim)" if [[ $TRAVIS_PYTHON_VERSION =~ ^2\. ]]; then INTERFACE="--interface tmux_nvim --python-host-prog=$PYTHON_CMD" - PY_IN_VIM="py" else INTERFACE="--interface tmux_nvim --python3-host-prog=$PYTHON_CMD" - PY_IN_VIM="py3" fi else echo "Unknown VIM_VERSION: $VIM_VERSION" exit 1 fi -if [[ $TRAVIS_PYTHON_VERSION =~ ^2\. ]]; then - PY_IN_VIM="py" -else - PY_IN_VIM="py3" -fi - PYTHON_VERSION=$($PYTHON_CMD -c 'import sys;print(sys.version.split()[0])') echo "Using python from: $PYTHON_CMD Version: $PYTHON_VERSION" echo "Using vim from: $VIM. Version: $($VIMn)"