[LyX/master] Amend f426470a

Enrico Forestieri forenr at lyx.org
Wed Sep 14 17:25:42 UTC 2022


commit 90551a03ac67a996eff0b9b643d376b4794fe87b
Author: Enrico Forestieri <forenr at lyx.org>
Date:   Wed Sep 14 20:10:01 2022 +0200

    Amend f426470a
    
    The synctex option can also be specified by a single dash and
    any value different from zero will do.
---
 src/Buffer.cpp |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index da630da..8ab86d4 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -1119,8 +1119,10 @@ bool Buffer::isSyncTeXenabled() const
 			const string dest = c.to().substr(0,3);
 			if (dest == "dvi" || dest == "pdf") {
 				const string cmd = c.command();
-				enabled |= cmd.find("--synctex=1") != string::npos;
-				if (enabled) break;
+				enabled |= cmd.find("-synctex=") != string::npos
+					&& cmd.find("-synctex=0") == string::npos;
+				if (enabled)
+					break;
 			}
 		}
 	return enabled;


More information about the lyx-cvs mailing list