equalsraf / vim-qt

An experimental Qt gui for Vim.
129 stars 14 forks source link

vim8 event loop and channels #12

Closed equalsraf closed 6 years ago

equalsraf commented 7 years ago

Testing on top of https://github.com/equalsraf/vim-qt/pull/11, terminal seems to be working.

I did not get a chance to look at FEAT_TIMERS, we are definitely no handling that. And the mch wait_for_char seems to have changed a lot, so I'm not sure how to handle it.

BlackIkeEagle commented 6 years ago

Hmm jumped it to quick, seems like in my case its not working, I have zsh as my shell and am still having issues with :terminal in the gui

equalsraf commented 6 years ago

What happened exactly? does it work with other shells?

In my case nothing got displayed in the terminal window.

BlackIkeEagle commented 6 years ago

I just get a black half screen where the terminal should be, but nothing else, and can't properly close after issueing :terminal

I just compiled it from master then ran src/vim -u NONE -U NONE -g

equalsraf commented 6 years ago

sigh, it seems i forgot to add some code in that pr, quick hack

diff --git a/src/qt/vimwrapper.cpp b/src/qt/vimwrapper.cpp
index 7ee8d1dc9..a5024eb8b 100644
--- a/src/qt/vimwrapper.cpp
+++ b/src/qt/vimwrapper.cpp
@@ -399,6 +399,10 @@ bool VimWrapper::processEvents(long wtime, bool inputOnly)
                }
        }

+#ifdef MESSAGE_QUEUE
+       parse_queued_messages();
+#endif
+
        int ret = FAIL;
        if ( wtime == -1 ) {
                QApplication::processEvents( QEventLoop::WaitForMoreEvents);
@@ -413,6 +417,10 @@ bool VimWrapper::processEvents(long wtime, bool inputOnly)
                do {

                        QApplication::processEvents( QEventLoop::WaitForMoreEvents);
+
+#ifdef MESSAGE_QUEUE
+                       parse_queued_messages();
+#endif
                        if ( hasPendingEvents() || !vim_is_input_buf_empty() ) {
                                goto out;
                        }

edit: i have not checked any deeper for correctness, so its possible im doing this in the wrong place