Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hinting/autocomplete #1

Closed
nbriz opened this issue Jul 2, 2020 · 0 comments
Closed

hinting/autocomplete #1

nbriz opened this issue Jul 2, 2020 · 0 comments
Assignees
Labels
task working on a thing

Comments

@nbriz
Copy link
Contributor

nbriz commented Jul 2, 2020

the core functionality for this is there (we get it for free via a CodeMirror addon), but it could be improved. specifically the HTML autocomplete always starts with < (rather than just having tag names like in most code editors). i had also made some other augmentations in my previous editors (need to review old code && see)

netitor/src/main.js

Lines 246 to 256 in 72afe70

_hinter (cm, options) {
// TODO consider how i might augment default lists (see my old hinters)
const pos = cm.getCursor()
const res = cm.getHelpers(pos, 'hint')[0](cm, options)
const lan = cm.getModeAt(pos).name
CodeMirror.on(res, 'select', (data) => {
const language = lan === 'xml' ? 'html' : lan
this.emit('hint-select', { language, data })
})
return res
}

@nbriz nbriz added the task working on a thing label Jul 2, 2020
@nbriz nbriz self-assigned this Jul 6, 2020
@nbriz nbriz closed this as completed Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task working on a thing
Projects
None yet
Development

No branches or pull requests

1 participant