reedline icon indicating copy to clipboard operation
reedline copied to clipboard

Find common string returns wrong index for the root that matches

Open alesito85 opened this issue 2 years ago • 0 comments

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

  1. Word list that the issue is seen in ["qml", "qmake", "qmltc", "qmlls", "qmldom", "qmake6", "qmltime", "qmllint", "qmlscene", "qmlformat", "qmleasing", "qmlpreview", "qmlprofiler", "qmlplugindump", "qmltestrunner"]
  2. Run this input through find_common_string
  3. Observe that the function returns index 3 when it should return 2

alesito85 avatar Feb 15 '23 12:02 alesito85