status collapsed
\begin_layout Plain Layout
-SumatraPDF.sh
+SumatraPDF -inverse-search "lyxeditor -g %f %l"
\end_layout
\end_inset
\end_inset
-, where
-\begin_inset Flex Code
-status collapsed
-
-\begin_layout Plain Layout
-SumatraPDF.sh
-\end_layout
-
-\end_inset
-
- is the following script (to be placed in your command PATH,
-\begin_inset Flex Code
-status collapsed
-
-\begin_layout Plain Layout
-/usr/local/bin
-\end_layout
-
-\end_inset
-
- being the best choice):
-\end_layout
-
-\begin_layout LyX-Code
-#!/bin/bash
-\begin_inset Newline newline
-\end_inset
-
-cd $(dirname $1)
-\begin_inset Newline newline
-\end_inset
-
-SumatraPDF -inverse-search "lyxeditor -g %f %l" $(basename $1)
-\end_layout
-
-\begin_layout Standard
-This wrapper script is needed because SumatraPDF is a native Windows application
- and does not understand the posix paths used by the Cygwin version of LyX.
- If SumatraPDF.exe is not in your command PATH, use its full posix path in
- the script above.
+.
+ If SumatraPDF.exe is not in your command PATH, use its full posix path.
The
\begin_inset Flex Code
status collapsed
#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"
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());
- Fix bug when exporting documents containing the command/character
"\iddots" in math to LyX 1.6.x.
+- Fix forward-search on Windows with SumatraPDF and, as a by-product,
+ allow using SumatraPDF on Cygwin without the need for a wrapper script.
+
* USER INTERFACE