Re: Problem with word completion (fixed in git)
Benno Schulenberg <[email protected]> Thu, 7 Aug 2025 15:50:05 +0200
| Newsgroups | gmane.editors.nano.devel |
|---|---|
| Message-ID | <[email protected]> |
Op 07-08-2025 om 10:36 schreef Ivan Vorontsov:
> 1. Let's start nano without a file just for experimentation.
> 2. Enter 1234 on the first line to have it in the buffer for subsequent
> completing.
> 3. Enter 1 on the second line, hit {complete}. It completes. {zap}.
> 4. Enter 12 on the second line, hit {complete}. It completes. {zap}.
> 5. Enter 123 on the second line, hit {complete}. It writes 'No matches'.
>
> So, when the word is entered without the last character it fails to
> complete. I think it's a bug.
Indeed. Thanks for reporting.
Apparently it happens only when the possible completion word occurs at
the very end of a line.
It's a classic off-by-one error. Fixed in git:
https://cgit.git.savannah.gnu.org/cgit/nano.git/commit/?id=70e580c0
The bug was rereported in https://savannah.gnu.org/bugs/?67405, with the
following recipe:
To reproduce, run `src/nano --ignore +51 README`.
See that the next line ends with "sensible", and two lines back ends with
"closely". Those are the only occurrences of those words in the file.
Now type: closel ^] sensibl ^]
See that both completions fail. Now type a space after "closely" on line 49
and after "sensible" on line 52. Then try the completion of "closel" and
"sensibl" again. They work now.
Benno
OpenPGP_signature.asc
(application/pgp-signature, 840 B)
-----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEEFo5vQpe/16ea/USWUUu+Lrjhlh8FAmiUrw4FAwAAAAAACgkQUUu+Lrjhlh98 jQ//ePZQKyDpqEl7M2DSTKvl+YR1pezY6uuh4uy1NVTectg7G75Cg9wwuYaR74/aUCT1vyGZ0TfQ dQkQ0n/s3U80P28pjp9wG2ktGDLjXx/SkhnYb+FLa0bCGHchd7wVPNqKq2nWnzDNuyICw/4CkJSU oZlJxMaTdWK6setNj+CXhWTyLxpbzUEH/sjesNbWQozwxmf2Fo9neamImZExBZOS3ROvcVcOtJum rIX1R8ngedMPjcoMzKTSZnfAOKBuPIp94BFlb4rVHWS4En/5AvEEpI7oINfOyupu+JfL0joutrEy 8svAVzR9STUR3rXcXrjOpet1F6bnUr4os55kw+H2U9KWHdpfg7VP9/PafBHKVvAE6Nw/8XAsZbE2 yoyop2SE+QmbJU0BsD3hSBqlMQ5ohjtyhvtOYezdm4IWoIO4DKqXHB2AIqcA6wVSidWstO+Y0rF0 eyPVSENJ8Jd4QWaTejmkw8XF+DswDlyVruJdQeYGorBucjHyGZfAlHfG1TjM2a96a94WfUkm6agX EQHetNwzT40AgTmsjy/Ly2vaJoIt+gcK8RzxQFayiRg5atmNuJE3S0reACIipsbMOcVJ04qv9Shb P2KIuUBZM4BG75u6l2YuQ5XZXUkbtwv9k3mrh2/w4VOfbEE6Ws7nflh8bEj89Hk9uba26JMsfVDK U8U= =/qKB -----END PGP SIGNATURE-----