achristmascarl / rainfrog

🐸 a database management tui for postgres
https://crates.io/crates/rainfrog
MIT License
2.86k stars 57 forks source link

fix copy to the linux system clipboard #120

Closed Distantoff closed 1 month ago

Distantoff commented 1 month ago

Hello! Thank you for your project, I liked it, but immediately I came across that the clipboard of the system was not working. I found the reason why this happens - the instance of arboard clipboard must run throughout the lifetime of the entire program.. Instead of copying text, signals are sent in the vim module, which are processed in the app, as well as components.

achristmascarl commented 1 month ago

(you can ignore this bot's feedback for now, it's just to flag anything else i might want to look at)

@greptileai

achristmascarl commented 1 month ago

hm after taking another look at vim_state and the command_tx registration, i think it might be better to always initialize vim_state with a pointer to a function in editor.rs that does the message sending instead since it already has the command_tx initialized.

i can make the edits directly after doing some testing if you dont mind

Distantoff commented 1 month ago

hm after taking another look at vim_state and the command_tx registration, i think it might be better to always initialize vim_state with a pointer to a function in editor.rs that does the message sending instead since it already has the command_tx initialized.

i can make the edits directly after doing some testing if you dont mind

editor.rs

Yes of course! Perhaps this is the best solution

achristmascarl commented 1 month ago

i couldn't get it to work with giving the vim_state a function pointer or closure to a function in editor, so i'll stick with your approach of having the command_tx registered in vim_state :)

did some profiling and cloning the command_tx every transition doesnt have any performance impact

Distantoff commented 1 month ago

i couldn't get it to work with giving the vim_state a function pointer or closure to a function in editor, so i'll stick with your approach of having the command_tx registered in vim_state :)

did some profiling and cloning the command_tx every transition doesnt have any performance impact

Yes, cloning command_tx as far as I know just copies the reference, so the number of sender can be created a lot

github-actions[bot] commented 1 month ago

Included in release v0.2.8