reedline
reedline copied to clipboard
Find common string returns wrong index for the root that matches
Platform macOS Terminal software nushell
I've noticed this issue in nushell and have reported it there https://github.com/nushell/nushell/issues/8078 The problem is that depending on the available words, the function could potentially return a wrong index at which the root ends.
Steps to reproduce
- Word list that the issue is seen in ["qml", "qmake", "qmltc", "qmlls", "qmldom", "qmake6", "qmltime", "qmllint", "qmlscene", "qmlformat", "qmleasing", "qmlpreview", "qmlprofiler", "qmlplugindump", "qmltestrunner"]
- Run this input through find_common_string
- Observe that the function returns index 3 when it should return 2