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

Bidi content when pasted during Bidi-Mode #5

Closed
mcookly opened this issue Apr 2, 2023 · 3 comments
Closed

Bidi content when pasted during Bidi-Mode #5

mcookly opened this issue Apr 2, 2023 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@mcookly
Copy link
Owner

mcookly commented Apr 2, 2023

Essentially, pipe register contents through fribidi() before inserting the text into the buffer.
Would it make more sense to assign a specific register to this or apply to all registers?

@mcookly mcookly added the enhancement New feature or request label Apr 2, 2023
@mcookly mcookly added this to the 1.0.0 milestone Apr 2, 2023
@mcookly
Copy link
Owner Author

mcookly commented Apr 2, 2023

I think I'll assign this functionality to all registers,
but rather than piping the register contents through fribidi(),
pasting will temporarily disable Bidi-Mode, insert contents, then re-enable Bidi-Mode.
That way padding for ML and MR base directions can be applied.
Unfortunately, there is no autocmd event for pasting,
so I think I will make a custom function and command that pastes from a specified register.
The user command (BidiPaste, which will only run when Bidi-Mode is enabled) should take the register name as input.
Perhaps the function (paste()) can detect the next keypress/letter (with option to ) to determine the register to paste from.
The user command can then simulate this keypress from the input.

@mcookly
Copy link
Owner Author

mcookly commented Apr 4, 2023

I think I will also use this functionality to correct lines/text that are bidi'd incorrectly.

@mcookly
Copy link
Owner Author

mcookly commented Apr 5, 2023

Added in 8fc5741

@mcookly mcookly closed this as completed Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant