nano-devel
[Top][All Lists]
Advanced

[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.

Attachment: persist-shift-selections-for-indent-unindent-comment.patch
Description: Text Data

Attachment: add-first-indentation-or-comment-sequence-to-selection.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]