-
Notifications
You must be signed in to change notification settings - Fork 13
Description
The command used to "Edit right file" or "Edit left" file is hardcoded to xterm -e vi if EDITOR is not set in the environment:
Lines 335 to 341 in 50cb42b
| const char* editor = getenv( "EDITOR" ); | |
| if ( editor != 0 ) { | |
| _commands[ CMD_EDIT ] = QString::fromLocal8Bit( editor ); | |
| } | |
| else { | |
| _commands[ CMD_EDIT ] = "xterm -e vi"; | |
| } |
This is not ideal since EDITOR is meant (by old convention) to refer to a command-line editor like vi or vim, not a graphical program. When these xxdiff menu options are used with EDITOR=vim, nothing happens, which is very confusing. The error message at the end of XxApp::editFIle is not shown, because the if ( ! _editProc[bufIdx]->waitForStarted() ) block is not entered:
Lines 2723 to 2738 in 50cb42b
| if ( _editProc[bufIdx] == NULL ) { | |
| _editProc[bufIdx] = new QProcess; | |
| connect( _editProc[bufIdx], SIGNAL(finished(int,QProcess::ExitStatus)), SLOT(redoDiff()) ); | |
| } | |
| _editProc[bufIdx]->start( executable, args ); | |
| if ( ! _editProc[bufIdx]->waitForStarted() ) { | |
| QString text; | |
| { | |
| QTextStream oss( &text ); | |
| oss << "There has been an error spawning the editor (" | |
| << executable << "): " | |
| << _editProc[bufIdx]->errorString() << Qt::endl; | |
| } | |
| new XxSuicideMessageBox( | |
| _mainWindow, "Error.", text, QMessageBox::Warning | |
| ); |
I didn't debug further, but it makes sense that invoking vim outside a terminal would not work. I would have expected the error message to be shown, though.