micro-editor / micro-editor/micro

[improvement] Use Gnu readline style tab completion instead of Cmd style completion in commands

Open
#1,576 1 comment 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
29.6k
Forks
1.4k
Avg merge
2d 18h
Merged PRs (30d)
10

Description

Description of the problem or steps to reproduce

I have a folder which contains files such as foo_bar.txt foo_baz.txt foo_xyz.txt and so on.
If I type the 'open' command and type just and "f" pressing tab will complete it "foo_bar.txt" then cycles through matches just like cmd does.
This is annoying as I have to type "foo_x" to be able to complete it correctly to foo_xyz.txt and if I don't type enough letters it will complete to the wrong file forcing me to backspace and correct manually.

Instead use GNU readline style completion which completes until the common prefix. So pressing "f" and tab should complete it until "foo_" allowing be to continue typing to disambiguate.
So opening foo_xyz.txt would be just f + tab + x + tab + enter. Instead of having to type "foo_x" + tab + enter, or having to use backspace to clear the wrong suggestion.

Or at least make it configurable.

Specifications

Version: 2.0.2
Commit hash: c51f849
Compiled on February 26, 2020
OS: Ubuntu 18.04

Interestingly on an old version 1.4.1 that is on my raspberry PI, tab completion works as expected: it uses the gnu readline way.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the command-completion path used by the open command and compare its current tab behavior with the GNU readline behavior described here. Use the reported foo_bar.txt, foo_baz.txt, and foo_xyz.txt case to verify completion stops at the common prefix, then confirm that subsequent input and Tab select the intended file.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.