Bug 83693

Summary: vim part fails to embed
Product: [Applications] kvim Reporter: Ben Burton <bab>
Component: Vim KPartAssignee: Mickael Marchand <kvim>
Severity: normal CC: lex.lists
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:

Description Ben Burton 2004-06-20 09:54:00 UTC
Version:            (using KDE KDE 3.2.3)
Installed from:    Debian testing/unstable Packages
OS:                Linux

Hi.  I've just discovered that the vimpart in KDE 3.2.3 on debian is no longer working.  I'm not sure for how long it's been like this.

The symptom is that the vimpart does not embed itself in the parent window.  Instead a new kvim window is opened, external to the parent application.

I can reliably reproduce this in kdevelop, as well as in regina (an app I work on that uses the default embedded text editor selected in kcontrol for its text editing).

The vimpart is configured to use kvim 1:6.2-532+4 over DCOP, and I get the same behaviour over Vim/X11.

FWIW, the random 10-letter servername is appearing in the external kvim window title.

Comment 1 Ben Burton 2004-06-30 11:46:00 UTC
Further information on this bug:  The reason kvim/gvim fails to embed is because the window title is not changed until too late.

Specifically, the kvim/gvim process begins with a window title of "kvim", "Vim" or whatever.  It then hands back control to the vimpart, and *then* processes the --cmd that changes the window title to the 10-letter random string.

If you're lucky, kvim/gvim manages to change its title before VimWidget::embedVimWid() is called, and it embeds properly.  (Well, it doesn't embed properly if you're using kdevelop but that's a different bug.)

If you're not lucky, VimWidget::embedVimWid() gets called first and it ignores the kvim/gvim window because it hasn't changed its title yet.  And you get the external GUI Vim process that I reported in this bug.

For kvim (guitype == 1), this can be fixed by passing --caption to the kvim process, which will set the window title correctly right from the beginning.  I've tested this and it works (in kwrite/etc, not in kdevelop), and I'll commit the fix to CVS shortly.

For other guitypes, such as vim-gtk and vim-gnome, I can't see how to solve it.  There don't seem to be any magic GTK arguments similar to KDE's --caption.  But basically you need to make sure the window title is always fixed before VimWidget::embedVimWid() gets to it.

Comment 2 Alexis Trudeau 2004-08-13 21:12:45 UTC
Version:           (using KDE 3.2.2)
Installed from:    Gentoo
OS:                Linux

I've experienced the same problem with gvim as the remote server. I tried to patch the problem, the same way Ben Burton did for KVim, by hacking through the vim code. I added a cmd-line argument similar to "--caption", so that the titlestring can be properly set right from the start. Unfortunately, that didn't do it.

On the other hand, by adding a sleep(1) after launch the vim process in the VimWidget constructor, I was able to make it work with gvim. I know it's a cheap hack, but it confirms that it's a syncing problem to be resolved. Going further than that, is beyond my capabilities and the time I have in hand.

I wish you luck for resolving that problem.


Comment 3 Paul Hoepfner-Homme 2005-03-19 22:38:25 UTC
FYI, this is still the case with the GVIM/X11 method after installing the latest vimpart package (3.4.0 on Gentoo). What's more, the GVIM window that pops up is always empty (it fails to open the text file I clicked on) rendering vimpart basically useless until this is fixed...
Comment 4 Shaun Jackman 2006-03-27 05:00:43 UTC
I've also encountered this same bug with vimpart 4:3.3.2-4 and both
vim-gtk 1:6.3-071+1sarge1 and 1:6.4-007+1. Is there any resolution or
work-around to this bug?

Comment 5 lexual 2006-04-27 09:31:49 UTC
The kvim application is no longer maintained or supported by it's authors.
See this page for some background: http://www.yzis.org/devel/history

Closing all bugs won't fix.

Some of the old kvim author's have started work on a new vi-like editor called 
yzis. Keeping in mind that it is pre-release software, you can check it out 
here: yzis.org