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

Mark autocomplete #377

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open

Mark autocomplete #377

wants to merge 25 commits into from

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!

@@ -21,6 +22,7 @@ export type LineProps = {
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!

src/plugins/marks/index.tsx Outdated Show resolved Hide resolved
@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