Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,20 @@ Bug Fixes
* Ensure fullscreen in fuzzy history search.


Internal
---------
* Better tests for `null_string` configuration option.
* Better cleanup of resources in the test suite.


Documentation
---------
* Add `help <keyword>` to TIPS.
* Refine inline help descriptions.
* Add `$VISUAL` environment variable hint to TIPS.


Internal
---------
* Better tests for `null_string` configuration option.
* Better cleanup of resources in the test suite.
* Simplify prettify/unprettify handlers.


1.57.0 (2026/02/25)
==============

Expand Down
20 changes: 4 additions & 16 deletions mycli/key_bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,8 @@ def _(event: KeyPressEvent) -> None:
_logger.debug("Detected <C-x p>/> key.")

b = event.app.current_buffer
cursorpos_relative = b.cursor_position / max(1, len(b.text))
pretty_text = mycli.handle_prettify_binding(b.text)
if len(pretty_text) > 0:
b.text = pretty_text
cursorpos_abs = int(round(cursorpos_relative * len(b.text)))
while 0 < cursorpos_abs < len(b.text) and b.text[cursorpos_abs] in (" ", "\n"):
cursorpos_abs -= 1
b.cursor_position = min(cursorpos_abs, len(b.text))
if b.text:
b.transform_region(0, len(b.text), mycli.handle_prettify_binding)

@kb.add("c-x", "u", filter=emacs_mode)
def _(event: KeyPressEvent) -> None:
Expand All @@ -185,14 +179,8 @@ def _(event: KeyPressEvent) -> None:
_logger.debug("Detected <C-x u>/< key.")

b = event.app.current_buffer
cursorpos_relative = b.cursor_position / max(1, len(b.text))
unpretty_text = mycli.handle_unprettify_binding(b.text)
if len(unpretty_text) > 0:
b.text = unpretty_text
cursorpos_abs = int(round(cursorpos_relative * len(b.text)))
while 0 < cursorpos_abs < len(b.text) and b.text[cursorpos_abs] in (" ", "\n"):
cursorpos_abs -= 1
b.cursor_position = min(cursorpos_abs, len(b.text))
if b.text:
b.transform_region(0, len(b.text), mycli.handle_unprettify_binding)

@kb.add("c-o", "d", filter=emacs_mode)
def _(event: KeyPressEvent) -> None:
Expand Down