CodeMirror autocomplete: Case In Sensitive Search

眉间皱痕 提交于 2019-12-13 08:08:19

问题


I'm using CodeMirror autocomplete in python mode (python-hint.js). I've customized the keyword list by adding my list. But it raises the case sensitive issue by not retrieving the capital keywords when providing keyword in small letter. Please where to make changes in python-hint.js file to make the search case in sensitive. Any help or suggestion is appreciated.


回答1:


You can implement the case-insensitive autoComplete feature by adding the following lines in Python-hint.js -> function maybeAdd(str)

 function maybeAdd(str) {
   start=start.toLowerCase();
   str=str.toLowerCase();
 //EXISTING CODE   
}

PS : Though it's highly recommended not to change the library files,as it might create problem when updating the version.



来源:https://stackoverflow.com/questions/22298737/codemirror-autocomplete-case-in-sensitive-search

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!