You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.registerGutter(name: string, priority: number) { ... }
// line numbers would have some special priority, 100 maybe?
// to add it to the right of them you'd have to specify more than that
// default would be 1
.unregisterGutter(name: string)
.clearGutter(name: string)
.setGutterMarker(name: string, line: number, marker: jQueryObj)
first two methods should probably live on EditorManager, the second two on Editor
This would enable extension authors to avoid/address any potential conflicts with existing gutters names and priorities. Both name and priorities should be unique - possibly throw errors on conflict.
Also is there any reason why all methods shouldn't be in Editor.js?
The reason I'd put registerGutter, unregisterGutter, getRegisteredGutters on the EditorManager and not the Editor itself, it's that I'm able to just call registerGutter on startup of my extension, and there'll always be reserved place for it. I don't have to manage on which Editor's I have registered my gutter and on which not. Of course if my extension is language specific we probably don't want to have gutters on all languages and this makes it kind of complex. We could add another parameter to be array of LanguageId's of default to be all languages.
But... if you want to make it simply, they can all live on the editor.
About the conflicts, I think we should hardcode priorities for inbuilt default gutters (line numbers, code folding) and console warning when someone else tries to use them. Besides that, let extensions set which priority they want. For example all my linting extensions would probably use the same priority, whatever the number would it be.
Merging this, @thehogfather please submit a PR with the API proposal or let me know if I should work on it. I've been hitting #12726 all the time and it's quite bad side effect. It can't make it to the release.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reverts #12673
The PR had some issues regarding scroll states in some cases which I didn't catch/that didn't occur to myself.
Let's revert the PR and think of nicer API instead.
Reopen #11577 #10864 and #12725 when this gets merged.
/cc @zaggino