Date: Fri, 3 Sep 2010 22:24:27 +0000 (UTC) From: Jilles Tjoelker <jilles@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r212191 - head/lib/libedit Message-ID: <201009032224.o83MOROe066443@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jilles Date: Fri Sep 3 22:24:26 2010 New Revision: 212191 URL: http://svn.freebsd.org/changeset/base/212191 Log: libedit: Do not move the cursor for ed-delete-next-char in emacs mode. This makes ed-delete-next-char suitable for mapping to the <Delete> key. Behaviour in vi mode is unchanged (for 'x'). Modified: head/lib/libedit/common.c Modified: head/lib/libedit/common.c ============================================================================== --- head/lib/libedit/common.c Fri Sep 3 22:13:54 2010 (r212190) +++ head/lib/libedit/common.c Fri Sep 3 22:24:26 2010 (r212191) @@ -163,15 +163,12 @@ ed_delete_next_char(EditLine *el, int c) return (CC_ERROR); #endif } - } else { - if (el->el_line.cursor != el->el_line.buffer) - el->el_line.cursor--; - else - return (CC_ERROR); - } + } else + return (CC_ERROR); } c_delafter(el, el->el_state.argument); /* delete after dot */ - if (el->el_line.cursor >= el->el_line.lastchar && + if (el->el_map.type == MAP_VI && + el->el_line.cursor >= el->el_line.lastchar && el->el_line.cursor > el->el_line.buffer) /* bounds check */ el->el_line.cursor = el->el_line.lastchar - 1;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009032224.o83MOROe066443>