-
Notifications
You must be signed in to change notification settings - Fork 112
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
Mark autocomplete #377
base: master
Are you sure you want to change the base?
Mark autocomplete #377
Conversation
nice, could you resolve conflicts? will test it out sometime when i get a chance! |
src/assets/ts/components/line.tsx
Outdated
@@ -21,6 +22,7 @@ export type LineProps = { | |||
wordHook?: PartialUnfolder<Token, React.ReactNode>; | |||
onCharClick?: ((col: Col, e: Event) => void) | undefined; | |||
cursorBetween?: boolean; | |||
session?: Session; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be better to not have the Session abstraction here and just pass in something like
renderLineAnnotationHook?: (info: { lineData: .., column: ..., cursors: ...}) => Array<React.ReactNode>,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got it working that way, but I had to bind the session to the function. Does that defeat the purpose? Genuinely curious exactly why this way is cleaner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, fine to bind the session to the function from the caller. i don't know if it really matters, was just going broadly by the principle of requiring less abstractions in interfaces :)
for example if you wrote a unit test for line.tsx it would be maybe annoying if you had to construct a session object to test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense, thanks for explaining!
I think it will be better to implement this as a mode, will update this later |
Adds an autocomplete menu when creating mark links. Navigate with up, down, and enter.