I wrote:

> Patch 9.0.0858
> Problem:    "!!sort" in a closed fold sorts too many lines.
> Solution:   Round to end of fold after adding the line count. (closes #11487)
> Files:      src/ex_docmd.c, src/testdir/test_fold.vim

I had been working on this and decided to finish it, but looking back
I'm not happy with this solution.  As I mentioned before, there are two
options:
- Expanding "!!" and then handling the expanded range - this seemed like
  the most user-friendly way, because you can see a range of lines is
  going to be operated upon before you hit Enter.
- Not expanding "!!" and including the whole fold when turning it into
  line numbers.  This doesn't give any hint about including the whole
  fold, thus it seemed not the best choice.

However, it turns out that we have an existing behavior that interferes:
Adding an offset to a range with a fold allowed for excluding or
including some lines above/below the end of the fold.  The second line
number is adjusted to the end of the closed fold before
adding/subtracting the offset.  Not sure if this is being actively used,
but at least there is a test for it.

I worked around it by checking for a dot before the offset. That's what
we get when expanding "!!" and the tests didn't have the dot, so it
works, the tests pass.  But it's a very subtle difference that most
likely confuses users, it requires reading the help to find out the
details.

This is really a choice between the two options that are neither good.
At this moment I think not expanding "!!" would be slightly better than
the presence of a dot making a difference.  Unless someone objects, I'm
going for the other choice.

-- 
Everybody lies, but it doesn't matter since nobody listens.
                                -- Lieberman's Law

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20221111114331.653CE1C108B%40moolenaar.net.

Raspunde prin e-mail lui