CodeMirror自动完成:区分大小写 [英] CodeMirror autocomplete: Case In Sensitive Search

查看:425
本文介绍了CodeMirror自动完成:区分大小写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在python模式(python-hint.js)中使用CodeMirror自动完成功能。
我通过添加列表来自定义了关键字列表。
但这引起了区分大小写的问题,因为在以小写字母提供关键字时不检索大写关键字。
请在python-hint.js文件中进行更改以使搜索大小写敏感。
感谢您的帮助或建议。

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.

推荐答案

您可以通过添加以下几行来实现不区分大小写的自动完成功能:在Python-hint.js中->函数mayAdd(str)

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:尽管强烈建议不要这样做更改库文件,因为在更新版本时可能会产生问题。

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

这篇关于CodeMirror自动完成:区分大小写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆