From 23b9f11b7a4c0b2eee86e8f5a93c015e0f0150e4 Mon Sep 17 00:00:00 2001 From: Johnson Date: Sun, 1 Apr 2018 14:45:17 +0800 Subject: [PATCH] Fix character selection when using VISUAL on all platforms (#926) --- pythonx/UltiSnips/text_objects/_visual.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pythonx/UltiSnips/text_objects/_visual.py b/pythonx/UltiSnips/text_objects/_visual.py index 00f5b64..143b30f 100644 --- a/pythonx/UltiSnips/text_objects/_visual.py +++ b/pythonx/UltiSnips/text_objects/_visual.py @@ -15,7 +15,6 @@ from UltiSnips import _vim from UltiSnips.indent_util import IndentUtil from UltiSnips.text_objects._transformation import TextObjectTransformation from UltiSnips.text_objects._base import NoneditableTextObject -import platform _REPLACE_NON_WS = re.compile(r"[^ \t]") @@ -43,8 +42,8 @@ class Visual(NoneditableTextObject, TextObjectTransformation): def _update(self, done): if self._mode == 'v': # Normal selection. - if platform.system() == 'Windows': - # Remove last character for windows in normal selection. + # Remove last character when selection mode is 'exclusive' + if _vim.eval('&selection') == 'exclusive': text = self._text[:-1] else: text = self._text