aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/prompt-toolkit/py2/prompt_toolkit/selection.py
diff options
context:
space:
mode:
authornkozlovskiy <nmk@ydb.tech>2023-09-29 12:24:06 +0300
committernkozlovskiy <nmk@ydb.tech>2023-09-29 12:41:34 +0300
commite0e3e1717e3d33762ce61950504f9637a6e669ed (patch)
treebca3ff6939b10ed60c3d5c12439963a1146b9711 /contrib/python/prompt-toolkit/py2/prompt_toolkit/selection.py
parent38f2c5852db84c7b4d83adfcb009eb61541d1ccd (diff)
downloadydb-e0e3e1717e3d33762ce61950504f9637a6e669ed.tar.gz
add ydb deps
Diffstat (limited to 'contrib/python/prompt-toolkit/py2/prompt_toolkit/selection.py')
-rw-r--r--contrib/python/prompt-toolkit/py2/prompt_toolkit/selection.py47
1 files changed, 47 insertions, 0 deletions
diff --git a/contrib/python/prompt-toolkit/py2/prompt_toolkit/selection.py b/contrib/python/prompt-toolkit/py2/prompt_toolkit/selection.py
new file mode 100644
index 0000000000..6582921222
--- /dev/null
+++ b/contrib/python/prompt-toolkit/py2/prompt_toolkit/selection.py
@@ -0,0 +1,47 @@
+"""
+Data structures for the selection.
+"""
+from __future__ import unicode_literals
+
+__all__ = (
+ 'SelectionType',
+ 'PasteMode',
+ 'SelectionState',
+)
+
+
+class SelectionType(object):
+ """
+ Type of selection.
+ """
+ #: Characters. (Visual in Vi.)
+ CHARACTERS = 'CHARACTERS'
+
+ #: Whole lines. (Visual-Line in Vi.)
+ LINES = 'LINES'
+
+ #: A block selection. (Visual-Block in Vi.)
+ BLOCK = 'BLOCK'
+
+
+class PasteMode(object):
+ EMACS = 'EMACS' # Yank like emacs.
+ VI_AFTER = 'VI_AFTER' # When pressing 'p' in Vi.
+ VI_BEFORE = 'VI_BEFORE' # When pressing 'P' in Vi.
+
+
+class SelectionState(object):
+ """
+ State of the current selection.
+
+ :param original_cursor_position: int
+ :param type: :class:`~.SelectionType`
+ """
+ def __init__(self, original_cursor_position=0, type=SelectionType.CHARACTERS):
+ self.original_cursor_position = original_cursor_position
+ self.type = type
+
+ def __repr__(self):
+ return '%s(original_cursor_position=%r, type=%r)' % (
+ self.__class__.__name__,
+ self.original_cursor_position, self.type)