sumatrapdf icon indicating copy to clipboard operation
sumatrapdf copied to clipboard

problem of forward search without opening program and with SessionData in SumatraPDF-settings.txt

Open DailyShana opened this issue 1 year ago • 3 comments

SumatraPDF version

  • Version 3.5-3.5.2 no problem in previous versions

Describe the bug without opening the sumatrapdf program and with SessionData in SumatraPDF-settings.txt, forward searching do not work.

To Reproduce Steps to reproduce the behavior:

  1. Download test file https://github.com/GitHubRulesOK/MyNotes/raw/master/AppNotes/SumatraPDF/LATeX%20and%20Reverse-Search.zip and extract, we have a folder \LATeX and Reverse-Search

  2. Download portable version of SumatraPDF (eg. version 3.5 64bit) and extract to the folder \LATeX and Reverse-Search

  3. delete SumatraPDF-settings.txt (if there is any)

  4. close all instance of SumatraPDF (if there is any), run "SumatraPDF-3.5-64.exe" -forward-search "sync.tex" 19 "sync.pdf"

  5. the line "A much longer and more evil second footnote" is highlighted as expected.

  6. close all instance of SumatraPDF, run "SumatraPDF-3.5-64.exe" -forward-search "sync.tex" 19 "sync.pdf" again

  7. the line "A much longer and more evil second footnote" is not highlighted as expected.

  8. close all instance of SumatraPDF, open SumatraPDF-settings.txt, delete SessionData section, save and close. image

  9. run "SumatraPDF-3.5-64.exe" -forward-search "sync.tex" 19 "sync.pdf" again

  10. the line "A much longer and more evil second footnote" is highlighted as expected.

Expected behavior In step 7 above, the line "A much longer and more evil second footnote" should be highlighed

File that reproduces the problem If this is related to a specific PDF etc. file, please attach the file.

Screenshots step 4-5 above: 动画1

step 6-7 above: 动画2

Additional context summary: If the pdf file is already opening, there is no problem. If SumatraPDF-settings.txt does not contain SessionData, there is no problem. The problem occurs when the pdf file is not opening and SumatraPDF-settings.txt contain SessionData.

DailyShana avatar May 12 '24 14:05 DailyShana

HaHa my example file, well AFAIK it works so testing 3.5.2 (I can only currently test 32bit)

but there are other conditions to be met. (tabs and reuse and interference by other files opening in a session.)

image

When using as a previewer newer SumatraPDF is best used in tabbed mode HOWEVER that can pre-load other files at the same time as previewing the target which can upset the calling sequence.

Best try with a separate portable copy where the settings can be kept static (or use a dedicated "appdata" dir)

if I adapt to

"..\SumatraPDF-3.5.2-32.exe" -appdata "%cd%" -forward-search "sync.tex" 19 "sync.pdf"

the setting will be in same working folder also note the test should highlight 2 areas note AND footnote image

GitHubRulesOK avatar May 12 '24 15:05 GitHubRulesOK

I update the reproduction of the problem with more detail.

If the pdf file is already opening, there is no problem. If SumatraPDF-settings.txt does not contain SessionData, there is no problem (eg. SumatraPDF-settings.txt does not exist). The problem occurs when the pdf file is not opening and SumatraPDF-settings.txt contains SessionData.

DailyShana avatar May 13 '24 01:05 DailyShana

That was what I meant by

HOWEVER that can pre-load other files at the same time as previewing the target which can upset the calling sequence.

GitHubRulesOK avatar May 13 '24 02:05 GitHubRulesOK