From 6cc845295fbd0ac2f80047f67a1e38e2209d91d1 Mon Sep 17 00:00:00 2001 From: "Iury O. G. Figueiredo" Date: Wed, 25 Mar 2020 01:31:59 +0000 Subject: [PATCH 1/3] Updating docs. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a568753..873b53c 100644 --- a/README.md +++ b/README.md @@ -139,5 +139,5 @@ Documentation The vy docs may be outdated sometimes, i struggle to do my best to keep it all fine. There also exists many features which weren't documented yet. -### [The Smoking Snake Book](https://github.com/iogf/vy/wiki) +### [Vy Book](https://github.com/iogf/vy/wiki) From 2a2c667c053264aa41c1e00a456a74ada8f7172b Mon Sep 17 00:00:00 2001 From: "Iury O. G. Figueiredo" Date: Fri, 3 Apr 2020 17:36:55 +0000 Subject: [PATCH 2/3] Improving. --- vyapp/plugins/blink_pair.py | 50 ++++++++++++++++++------------------- vyapp/vyrc | 2 +- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/vyapp/plugins/blink_pair.py b/vyapp/plugins/blink_pair.py index d4f3628..e2f2c58 100644 --- a/vyapp/plugins/blink_pair.py +++ b/vyapp/plugins/blink_pair.py @@ -13,30 +13,30 @@ class BlinkPair: setup={'background':'pink', 'foreground':'black'} max=1500 - timeout=1000 - - def __init__(self, area, *pairs): - self.pairs = pairs - self.area = area - - self.area.tag_config('(BLINK)', **self.setup) - self.id = self.area.hook('blink-pair', '-1', - '', lambda e: self.scale()) - - self.area.hook('blink-pair', '-1', '', - lambda e: self.area.after_cancel(self.id)) - - def scale(self): - self.id = self.area.after(self.timeout, self.scale) - index0 = 'insert -%sc' % self.max - index1 = 'insert +%sc' % self.max - - if self.area.tag_ranges('(BLINK)'): - self.area.tag_remove('(BLINK)', index0, index1) - for lhs, lhr in self.pairs: - index = self.area.case_pair( - 'insert', self.max, lhs, lhr) - if index: self.area.tag_add( - '(BLINK)', index, '%s +1c' % index) + timeout=2000 + pairs = ('(', ')'), ('[', ']'), ('{', '}') + + def __init__(self, area): + area.tag_config('(BLINK)', **self.setup) + + @classmethod + def scale(cls): + loop = lambda: root.after(cls.timeout, cls.scale) + root.after_idle(loop) + area = root.focus_get() + if isinstance(area, AreaVi): + cls.blink(area) + + @classmethod + def blink(cls, area): + index0 = 'insert -%sc' % cls.max + index1 = 'insert +%sc' % cls.max + + area.tag_remove('(BLINK)', index0, index1) + for lhs, lhr in cls.pairs: + index = area.case_pair('insert', cls.max, lhs, lhr) + if index: + area.tag_add('(BLINK)', index, '%s +1c' % index) install = BlinkPair +root.bind('<>', lambda event: BlinkPair.scale()) \ No newline at end of file diff --git a/vyapp/vyrc b/vyapp/vyrc index 098c826..009bb27 100644 --- a/vyapp/vyrc +++ b/vyapp/vyrc @@ -201,7 +201,7 @@ autoload(data_del) # Used to highlight pairs of character like () {} []. # It is useful when playing with lisp things. from vyapp.plugins import blink_pair -autoload(blink_pair, ('(', ')'), ('[', ']'), ('{', '}')) +autoload(blink_pair) # Used to complete words when Control-q is issued on insert mode. from vyapp.plugins import word_completion From c8108a51f22b14a2aae56848267597d9219f8416 Mon Sep 17 00:00:00 2001 From: "Iury O. G. Figueiredo" Date: Fri, 3 Apr 2020 17:37:49 +0000 Subject: [PATCH 3/3] Fixing setup version. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f84a160..b39cdc7 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from distutils.core import setup setup(name="vy", - version="4.1.0", + version="4.2.0", description="A vim-like in python made from scratch.", packages=["vyapp", "vyapp.plugins",