From 09cf7f14be8e286f81d3ccf522e121d4c46eb287 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Fri, 22 Jan 2021 23:09:38 +0800 Subject: [PATCH] edit (ble/widget/kill-forward-logical-line): fix undeleted newlines at EOL --- memo/ChangeLog.md | 3 ++- src/edit.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/memo/ChangeLog.md b/memo/ChangeLog.md index e3bf82b1..f913f6fb 100644 --- a/memo/ChangeLog.md +++ b/memo/ChangeLog.md @@ -24,7 +24,8 @@ - edit (command-help): work around the Bash bug that tempenv vanishes with `builtin eval` `#D1438` 8379d4a - global: suppress missing locale errors (reported by 3ximus) `#D1440` 4d3c595 - edit (sword): fix definition of `sword` (shell words) `#D1441` f923388 -- edit (kill/copy): combine multiple kills and copies (suggested by 3ximus) `#D1443` 0000000 +- edit (kill/copy): combine multiple kills and copies (suggested by 3ximus) `#D1443` 66564e1 +- edit (`kill-forward-logical-line`): fix a bug not deleting newline at the end of the line `#D1443` 0000000 ## Internal changes and fixes diff --git a/src/edit.sh b/src/edit.sh index 541a3abf..1fb488f3 100644 --- a/src/edit.sh +++ b/src/edit.sh @@ -3708,7 +3708,7 @@ function ble/widget/kill-forward-logical-line { else local ret; ble-edit/content/find-logical-eol # 行末にいるとき無引数で呼び出すと、直後の改行を削除 - ((ret<${#_ble_edit_ind}&&_ble_edit_ind==ret&&ret++)) + ((ret<${#_ble_edit_str}&&_ble_edit_ind==ret&&ret++)) fi ble/widget/.kill-range "$_ble_edit_ind" "$ret" }