Skip to content

Don't associate a single fd with both channel out and err#651

Merged
splhack merged 1 commit intomacvim-dev:masterfrom
ichizok:fix/gui-channel
Mar 22, 2018
Merged

Don't associate a single fd with both channel out and err#651
splhack merged 1 commit intomacvim-dev:masterfrom
ichizok:fix/gui-channel

Conversation

@ichizok
Copy link
Copy Markdown
Member

@ichizok ichizok commented Mar 16, 2018

fixes #579 (maybe there is more)

When register a single fd to dispatch-source twice (as ch-out and ch-err), the order of dispatching read-event of ch-out and ch-err cannot be determined.
Meanwhile, write-to-buffer is executed in the order of ch-out and ch-err.

  1. receive read-event from ch-err ... (A)
  2. receive read-eventfrom ch-out ... (B)
  3. write the content of ch-out (B) to buffer
  4. write the content of ch-err (A) to buffer

In this way the content of buffer becomes messed up.

Therefore, a single fd should be handled by a single handler.

@splhack
Copy link
Copy Markdown
Contributor

splhack commented Mar 16, 2018

👍
can we send it to upstream? or can we have #ifdef FEAT_GUI_MACVIM around the modification?

@ichizok
Copy link
Copy Markdown
Member Author

ichizok commented Mar 16, 2018

I think it also needs for upstream, but I'd like to present together other fixes.
So we should apply it prior to upstream since there is marked problem(s) especially for MacVim GUI.

@splhack
Copy link
Copy Markdown
Contributor

splhack commented Mar 16, 2018

do you mind to add #ifdef FEAT_GUI_MACVIM in order to keep the original code? it will help merging future.

Or the order of ch-out and ch-err about dispatch-read and write-to-buffer
would be inconsistent.
@ichizok
Copy link
Copy Markdown
Member Author

ichizok commented Mar 22, 2018

I updated PR: modified the patch and added #ifdef FEAT_GUI_MACVIM.

@splhack splhack merged commit 4b08a13 into macvim-dev:master Mar 22, 2018
@splhack
Copy link
Copy Markdown
Contributor

splhack commented Mar 22, 2018

👍

@ichizok ichizok deleted the fix/gui-channel branch March 22, 2018 14:20
@CGamesPlay CGamesPlay mentioned this pull request Mar 22, 2018
12 tasks
@splhack splhack mentioned this pull request Mar 27, 2018
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.

FZF and MacVim rendering issue

2 participants