[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nano-devel] [BUGS?] indenting shift selections
From: |
Brand Huntsman |
Subject: |
Re: [Nano-devel] [BUGS?] indenting shift selections |
Date: |
Fri, 8 Dec 2017 21:23:26 -0700 |
On Fri, 8 Dec 2017 15:20:52 -0700
Brand Huntsman <address@hidden> wrote:
> > But... maybe an exception
> > could/should be made when the mark/cursor are at the head of a
> > line?
>
> It should also work if only whitespace is before the top cursor,
> because the bottom cursor moves to encompass its indent, so should
> the top. But only for do_indent(). And only if the top cursor is at
> the head of the line for do_comment().
Allowing whitespace before top cursor is a bad idea, there are valid cases for
mixing tabs and spaces or adding extra spaces that aren't a full indent. It
would be complex to detect where to move top cursor back to and cause issues if
it guesses wrong.
The attached patch moves top cursor back when indenting or commenting, but only
if top cursor is at the start of the line. It works for both top-to-bottom and
bottom-to-top selections. I also attached your patch with do_comment() support
in case anyone else wants to test it.
persist-shift-selections-for-indent-unindent-comment.patch
Description: Text Data
add-first-indentation-or-comment-sequence-to-selection.patch
Description: Text Data
- [Nano-devel] [BUGS?] indenting shift selections, Brand Huntsman, 2017/12/07
- Re: [Nano-devel] [BUGS?] indenting shift selections, Benno Schulenberg, 2017/12/08
- Re: [Nano-devel] [BUGS?] indenting shift selections, Brand Huntsman, 2017/12/08
- Re: [Nano-devel] [BUGS?] indenting shift selections,
Brand Huntsman <=
- Re: [Nano-devel] [BUGS?] indenting shift selections, Benno Schulenberg, 2017/12/10
- Re: [Nano-devel] [BUGS?] indenting shift selections, Brand Huntsman, 2017/12/10
- Re: [Nano-devel] [BUGS?] indenting shift selections, Benno Schulenberg, 2017/12/11
- Re: [Nano-devel] [BUGS?] indenting shift selections, Brand Huntsman, 2017/12/11
- [Nano-devel] RFC: change the behavior when indenting/commenting a marked region?, Benno Schulenberg, 2017/12/12
- Re: [Nano-devel] RFC: change the behavior when indenting/commenting a marked region?, Benno Schulenberg, 2017/12/15
- Re: [Nano-devel] [BUGS?] indenting shift selections, Benno Schulenberg, 2017/12/10