0

For years, I've used SumatraPDF in conjunction Vim (with Vimtex) for LaTeX editing. Inverse search is accomplished with gvim -c ":RemoteOpen +%l %f" in Settings > Options. After my recent upgrade from 3.4.6 to 3.5.2, that no longer works. My setting is replaced with "C:\...\AppData\Local\Programs\Microsoft VS Code\Code.exe" --goto %f:%l. I can put mine back in, but it is not saved when I quit and relaunch Sumatra.

My SumatraPDF-settings.txt in %LOCALAPPDATA%\SumatraPDF has not been modified since before the upgrade and still contains this line

InverseSearchCmdLine = gvim -c ":RemoteOpen +%l %f"

but apparently Sumatra is no longer using that file. When I click Settings > Advanced options, it opens an empty c:\Program Files (x86)\SumatraPDF\(x86)\SumatraPDF\SumatraPDF-settings.txt in VS code, which I can't save after editing for lack of permission (the full path doesn't even exist). How can I get Sumatra to use the old settings file at the old location just as it did before.

Update. I've gotten the settings file to load by copying it to c:\Program Files (x86)\SumatraPDF\, which is where the executable is, but that doesn't seem like best practice. There was, by the way, no settings file there before my intervention.

bongbang
  • 133

2 Answers2

1

When installed as a portable app (from Zip file) (and possibly in other cases), Sumatra PDF Reader must be in a folder for which the user has write permission, so that changes to SumatraPDF-settings.txt can be stored.

Here are some ways this can be accomplished:

  • Put the application in C:\Users\<user-name>\AppData\Local\SumatraPDF\SumatraPDF.exe
  • Install in C:\Program Files\SumatraPDF, but change permission to allow user to write there (possibly a security risk, though mild).
  • Install in C:\Program Files\SumatraPDF, and run SumatraPDF.exe as Administrator when changing settings. I use that to advantage, because I can set a list of files in MRU and make changes to settings as admin, and, when running as normal user, those are preserved even if In open of close additional files or make temporary changes to settings -- close the app and reopen, and the permanent setup is restored.
0

Current Stable SumatraPDF may have different behaviours in 3.5.2 compared to previous.

For an all users installed copy the exe should be in %programfiles%\sumatrapdf

i.e. c:\Program Files\SumatraPDF\SumatraPDF.exe
or c:\Program Files (x86)\SumatraPDF\SumatraPDF.exe

Each users data in %localappdata%\SumatraPDF\SumatraPDF-settings.txt enter image description here

Thus always best to check the current "Pre Release" to check if it has been a closed issue.

The description of this problem may be down to unexpected Username as that is where the path will be variable.

Common Problems with user names that affect NOT just SumatraPDF are

Non A-z i.e. "punctuation" such as spaces (I know it should not be like that on Windows but not all functions know that).

Also not uncommon that non ASCII Characters such as accented or CJK / UTF will throw off file functions.

A frequent problem with debugging such issues is that c:\Users\"User"\appdata will redact their names so it is not clear from the outset which characters are present (or missing).

Please ensure in bug reports you identify any such characters.

K J
  • 1,248