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:
|
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:
|
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.
The command used to "Edit right file" or "Edit left" file is hardcoded to
xterm -e viifEDITORis not set in the environment:xxdiff/src/resources.cpp
Lines 335 to 341 in 50cb42b
This is not ideal since
EDITORis meant (by old convention) to refer to a command-line editor likeviorvim, not a graphical program. When these xxdiff menu options are used withEDITOR=vim, nothing happens, which is very confusing. The error message at the end ofXxApp::editFIleis not shown, because theif ( ! _editProc[bufIdx]->waitForStarted() )block is not entered:xxdiff/src/app.cpp
Lines 2723 to 2738 in 50cb42b
I didn't debug further, but it makes sense that invoking
vimoutside a terminal would not work. I would have expected the error message to be shown, though.