Guest User

Untitled

a guest
Sep 17th, 2024
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.73 KB | None | 0 0
  1. diff --git a/pdf_viewer/main_widget.cpp b/pdf_viewer/main_widget.cpp
  2. index 19b568b..d36d22c 100644
  3. --- a/pdf_viewer/main_widget.cpp
  4. +++ b/pdf_viewer/main_widget.cpp
  5. @@ -4152,26 +4152,18 @@ void MainWidget::synctex_under_pos(WindowPos position) {
  6.             if (column < 0) column = 0;
  7.             int tag = synctex_node_tag(node);
  8.             const char* file_name = synctex_scanner_get_name(scanner, tag);
  9. -#ifdef Q_OS_WIN
  10. -            // the path returned by synctex is formatted in unix style, for example it is something like this
  11. -           // in windows: d:/some/path/file.pdf
  12. -            // this doesn't work with Vimtex for some reason, so here we have to convert the path separators
  13. -           // to windows style and make sure the driver letter is capitalized
  14. -            QDir file_path = QDir(file_name);
  15. -            QString new_path = QDir::toNativeSeparators(file_path.absolutePath());
  16. -            new_path[0] = new_path[0].toUpper();
  17. -
  18. -#endif
  19. +                        QDir file_path = QDir(file_name);
  20. +                        QString new_path = QDir::toNativeSeparators(file_path.absolutePath());
  21.  
  22. +                        new_path.prepend("\"");
  23. +               new_path.append("\"");
  24. +              
  25.             std::string line_string = std::to_string(line);
  26.             std::string column_string = std::to_string(column);
  27.  
  28.             if (inverse_search_command.size() > 0) {
  29. -#ifdef Q_OS_WIN
  30.                 QString command = QString::fromStdWString(inverse_search_command).arg(new_path, line_string.c_str(), column_string.c_str());
  31. -#else
  32. -               QString command = QString::fromStdWString(inverse_search_command).arg(file_name, line_string.c_str(), column_string.c_str());
  33. -#endif
  34. +
  35.                  std::wstring res = command.toStdWString();
  36.                 QProcess::startDetached(command);
  37.             }
  38.  
Advertisement
Add Comment
Please, Sign In to add comment