Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/pdf_viewer/main_widget.cpp b/pdf_viewer/main_widget.cpp
- index 19b568b..d36d22c 100644
- --- a/pdf_viewer/main_widget.cpp
- +++ b/pdf_viewer/main_widget.cpp
- @@ -4152,26 +4152,18 @@ void MainWidget::synctex_under_pos(WindowPos position) {
- if (column < 0) column = 0;
- int tag = synctex_node_tag(node);
- const char* file_name = synctex_scanner_get_name(scanner, tag);
- -#ifdef Q_OS_WIN
- - // the path returned by synctex is formatted in unix style, for example it is something like this
- - // in windows: d:/some/path/file.pdf
- - // this doesn't work with Vimtex for some reason, so here we have to convert the path separators
- - // to windows style and make sure the driver letter is capitalized
- - QDir file_path = QDir(file_name);
- - QString new_path = QDir::toNativeSeparators(file_path.absolutePath());
- - new_path[0] = new_path[0].toUpper();
- -
- -#endif
- + QDir file_path = QDir(file_name);
- + QString new_path = QDir::toNativeSeparators(file_path.absolutePath());
- + new_path.prepend("\"");
- + new_path.append("\"");
- +
- std::string line_string = std::to_string(line);
- std::string column_string = std::to_string(column);
- if (inverse_search_command.size() > 0) {
- -#ifdef Q_OS_WIN
- QString command = QString::fromStdWString(inverse_search_command).arg(new_path, line_string.c_str(), column_string.c_str());
- -#else
- - QString command = QString::fromStdWString(inverse_search_command).arg(file_name, line_string.c_str(), column_string.c_str());
- -#endif
- +
- std::wstring res = command.toStdWString();
- QProcess::startDetached(command);
- }
Advertisement
Add Comment
Please, Sign In to add comment