Skip to content

Conversation

@platers
Copy link
Contributor

@platers platers commented Apr 1, 2021


Capture

Adds an autocomplete menu when creating mark links. Navigate with up, down, and enter.

@WuTheFWasThat
Copy link
Owner

nice, could you resolve conflicts? will test it out sometime when i get a chance!

wordHook?: PartialUnfolder<Token, React.ReactNode>;
onCharClick?: ((col: Col, e: Event) => void) | undefined;
cursorBetween?: boolean;
session?: Session;
Copy link
Owner

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>,

Copy link
Contributor Author

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.

Copy link
Owner

@WuTheFWasThat WuTheFWasThat Apr 4, 2021

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

Copy link
Contributor Author

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!

@platers
Copy link
Contributor Author

platers commented Apr 10, 2021

I think it will be better to implement this as a mode, will update this later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants