bugGNU nano - Bugs: bug #61367, the M-D word count is inconsistent...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #61367: the M-D word count is inconsistent with how Ctrl+Left/Right move

Submitter:  Benno Schulenberg <bens>
Submitted:  Fri 22 Oct 2021 01:29:37 PM UTC
   
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Wed 27 Oct 2021 02:37:44 PM UTC, comment #1: 

Fixed in git, commit 33041d0a, by passing the WORD_BOUNDS flag to do_next_word(), like everywhere else.

(The subsequent commit elides the second parameter of do_next_word(), as it has now become redundant.)

Benno Schulenberg <bens>
Group administrator
Fri 22 Oct 2021 01:29:37 PM UTC, original submission:  

To see what I mean, run:

echo "   one ;;; two" >words
echo "blue-bearded clear-headed swede" >>words
src/nano --ignore words

Then type: M-D

See that it says: 6 words.  From a human viewpoint this can't be right -- there are either five words or seven words, depending on whether you consider hyphenated things as a single word.

Now type Ctrl+Right seven times.  See that according to the word-jumping function there are seven words.

Now exit and run 'src/nano --ignore words -W'.  Type M-D and see there are still six words.  Then type Ctrl+Right six times.  See that the word-jumping sees six words.  It considers ";;;" to be a word, which very few people would do, but at least now the count and the jumping are consistent.

Now run 'vim words' and type: g ^G.  It says there are six words.  Use Ctrl+Right.  It jumps over six words, behaving like 'nano -W'.  Okay, consistent.  Exit with: :q!

Now run 'emacs words' and type: M-- M-=.  It says there are seven words.  Use Ctrl+Right.  It jumps to the ends of seven words.  Good, consistent.  Exit with: ^G ^X ^C

Expected behavior: the -W (--wordbounds) option should affect the M-D word count, so that it is consistent with the word-jumping cursor movement.

Benno Schulenberg <bens>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-12-16 bens Open/ClosedOpen Closed
    2021-10-27 bens StatusNone Fixed
    2021-10-24 bens Assigned toNone bens

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code