Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0b5e187be5 | ||
|
|
ee13b7bb78 | ||
|
|
cad35f7b4d | ||
|
|
c1a9823894 | ||
|
|
899eb6f879 | ||
|
|
945e0b1620 | ||
|
|
1f348882b8 |
@@ -1,5 +1,6 @@
|
|||||||
[](https://dev.azure.com/asottile/asottile/_build/latest?definitionId=29&branchName=master)
|
[](https://dev.azure.com/asottile/asottile/_build/latest?definitionId=29&branchName=master)
|
||||||
[](https://dev.azure.com/asottile/asottile/_build/latest?definitionId=29&branchName=master)
|
[](https://dev.azure.com/asottile/asottile/_build/latest?definitionId=29&branchName=master)
|
||||||
|
[](https://results.pre-commit.ci/latest/github/asottile/babi/master)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ resources:
|
|||||||
ref: refs/tags/v2.0.0
|
ref: refs/tags/v2.0.0
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
- template: job--pre-commit.yml@asottile
|
|
||||||
- template: job--python-tox.yml@asottile
|
- template: job--python-tox.yml@asottile
|
||||||
parameters:
|
parameters:
|
||||||
toxenvs: [pypy3, py36, py37, py38, py39]
|
toxenvs: [pypy3, py36, py37, py38, py39]
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ KEYNAME_REWRITE = {
|
|||||||
b'^?': b'KEY_BACKSPACE',
|
b'^?': b'KEY_BACKSPACE',
|
||||||
# linux, perhaps others
|
# linux, perhaps others
|
||||||
b'^H': b'KEY_BACKSPACE', # ^Backspace on my keyboard
|
b'^H': b'KEY_BACKSPACE', # ^Backspace on my keyboard
|
||||||
|
b'^D': b'KEY_DC',
|
||||||
b'PADENTER': b'^M', # Enter on numpad
|
b'PADENTER': b'^M', # Enter on numpad
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -592,7 +593,10 @@ class Screen:
|
|||||||
|
|
||||||
def _init_screen() -> 'curses._CursesWindow':
|
def _init_screen() -> 'curses._CursesWindow':
|
||||||
# set the escape delay so curses does not pause waiting for sequences
|
# set the escape delay so curses does not pause waiting for sequences
|
||||||
if sys.version_info >= (3, 9): # pragma: no cover
|
if (
|
||||||
|
sys.version_info >= (3, 9) and
|
||||||
|
hasattr(curses, 'set_escdelay')
|
||||||
|
): # pragma: no cover
|
||||||
curses.set_escdelay(25)
|
curses.set_escdelay(25)
|
||||||
else: # pragma: no cover
|
else: # pragma: no cover
|
||||||
os.environ.setdefault('ESCDELAY', '25')
|
os.environ.setdefault('ESCDELAY', '25')
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
name = babi
|
name = babi
|
||||||
version = 0.0.18
|
version = 0.0.19
|
||||||
description = a text editor
|
description = a text editor
|
||||||
long_description = file: README.md
|
long_description = file: README.md
|
||||||
long_description_content_type = text/markdown
|
long_description_content_type = text/markdown
|
||||||
|
|||||||
@@ -290,6 +290,7 @@ KEYS = [
|
|||||||
Key('^_', b'^_', '\x1f'),
|
Key('^_', b'^_', '\x1f'),
|
||||||
Key('^\\', b'^\\', '\x1c'),
|
Key('^\\', b'^\\', '\x1c'),
|
||||||
Key('!resize', b'KEY_RESIZE', curses.KEY_RESIZE),
|
Key('!resize', b'KEY_RESIZE', curses.KEY_RESIZE),
|
||||||
|
Key('^D', b'^D', '\x04'),
|
||||||
]
|
]
|
||||||
KEYS_TMUX = {k.tmux: k.wch for k in KEYS}
|
KEYS_TMUX = {k.tmux: k.wch for k in KEYS}
|
||||||
KEYS_CURSES = {k.value: k.curses for k in KEYS}
|
KEYS_CURSES = {k.value: k.curses for k in KEYS}
|
||||||
|
|||||||
@@ -72,14 +72,15 @@ def test_delete_at_end_of_file(run, tmpdir):
|
|||||||
h.await_text_missing('*')
|
h.await_text_missing('*')
|
||||||
|
|
||||||
|
|
||||||
def test_delete_removes_character_afterwards(run, tmpdir):
|
@pytest.mark.parametrize('key', ('DC', '^D'))
|
||||||
|
def test_delete_removes_character_afterwards(run, tmpdir, key):
|
||||||
f = tmpdir.join('f')
|
f = tmpdir.join('f')
|
||||||
f.write('hello world')
|
f.write('hello world')
|
||||||
|
|
||||||
with run(str(f)) as h, and_exit(h):
|
with run(str(f)) as h, and_exit(h):
|
||||||
h.await_text('hello world')
|
h.await_text('hello world')
|
||||||
h.press('Right')
|
h.press('Right')
|
||||||
h.press('DC')
|
h.press(key)
|
||||||
h.await_text('hllo world')
|
h.await_text('hllo world')
|
||||||
h.await_text('f *')
|
h.await_text('f *')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user