mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 19:07:45 +00:00
When previewing a format, change to the directory of the previewed file
and invoke the previewer with only its filename without the path. This solves the problem about forward search on Windows reported here: http://thread.gmane.org/gmane.editors.lyx.general/71130 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39410 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
54e54860e5
commit
56e1cbbdff
@ -23,6 +23,7 @@
|
||||
#include "support/gettext.h"
|
||||
#include "support/lstrings.h"
|
||||
#include "support/os.h"
|
||||
#include "support/Path.h"
|
||||
#include "support/Systemcall.h"
|
||||
#include "support/textutils.h"
|
||||
#include "support/Translator.h"
|
||||
@ -312,13 +313,14 @@ bool Formats::view(Buffer const & buffer, FileName const & filename,
|
||||
if (!contains(command, token_from_format))
|
||||
command += ' ' + token_from_format;
|
||||
|
||||
command = subst(command, token_from_format, quoteName(filename.toFilesystemEncoding()));
|
||||
command = subst(command, token_from_format, quoteName(onlyFileName(filename.toFilesystemEncoding())));
|
||||
command = subst(command, token_path_format, quoteName(onlyPath(filename.toFilesystemEncoding())));
|
||||
command = subst(command, token_socket_format, quoteName(theServerSocket().address()));
|
||||
LYXERR(Debug::FILES, "Executing command: " << command);
|
||||
// FIXME UNICODE utf8 can be wrong for files
|
||||
buffer.message(_("Executing command: ") + from_utf8(command));
|
||||
|
||||
PathChanger p(filename.onlyPath());
|
||||
Systemcall one;
|
||||
one.startscript(Systemcall::DontWait, command, buffer.filePath());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user