最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - Live autocomplete in Codemirror - Stack Overflow

matteradmin7PV0评论

It seems that Codemirror plugin show-hint is activated by shortcut. I need to implement live autoplete functionality, i.e. show hints after user entered first letters of keyword. Is there a way to do this with Codemirror?

It seems that Codemirror plugin show-hint is activated by shortcut. I need to implement live autoplete functionality, i.e. show hints after user entered first letters of keyword. Is there a way to do this with Codemirror?

Share Improve this question asked Jan 24, 2018 at 9:41 Eugene KrakosEugene Krakos 1591 silver badge8 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 2

Yes, there is a way to do this with CodeMirror. You can see the description of the addon for this here. CodeMirror offers the hint/show-hint.js addon that allows you to display hints when a keyboard short-cut is used.

You can find additional information on adding hints in this StackOverflow question as well.

Additionally, you can checkout their demo here.

You could have a function that is fired off after a keyup event. An example of an implementation is in this Stack Overflow answer.

Post a comment

comment list (0)

  1. No comments so far