[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nano-devel] [PATCH] text: let indenting/commenting skip the last li
From: |
Benno Schulenberg |
Subject: |
Re: [Nano-devel] [PATCH] text: let indenting/commenting skip the last line i |
Date: |
Wed, 20 Dec 2017 19:48:53 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 |
Op 19-12-17 om 21:34 schreef David Ramsey:
Benno Schulenberg:
If the marked region ends at the start of a line, do not include that
line in the indenting/undenting or commenting/uncommenting.
Good idea.
May I understand that you are in favor of the change? :)
However, in the patch's added function get_region():
+ if (*bot_x == 0) {
+ *bot = (*bot)->prev;
+ *bot_x = mbstrlen((*bot)->data);
+ }
This should use strlen() instead of mbstrlen(). The latter function
counts characters instead of bytes, and bot_x is not a character
count, but an index.
Ah. Thanks for noticing that. However, soon after, I realized that
bot_x and top_x are not used at all by do_indent() and its brothers.
So... there is no point in setting them to any value. In a follow-up
patch I have deleted those two parameters. Coming up.
Benno