Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find Usages+Replace all changes hidden files which will not be saved #3865

Open
octaeder opened this issue Nov 1, 2024 · 5 comments
Open

Comments

@octaeder
Copy link
Contributor

octaeder commented Nov 1, 2024

Environment

  • TeXstudio: current master (local msys2 build)
  • Qt: 6.8.0
  • OS: Windows10
  • TeX distribution: miktex

Expected behavior

After replacing labels in hidden files these files should be saved when compiling or using save all

Actual behavior

When I open a root document with a label and use Find Usages (context menu) the search results can be changed by using Replace all. This can affect hidden files. In this case the changed label there will not take effect because compiling will not save the hidden file. Also using Save All will not save it. Thus latex will throw missing label messages.

How to reproduce

root:

\documentclass{article}
\begin{document}
\input{a1}
$\sqrt{2}$\ref{sec:root-inline}
\end{document}

a1.tex:

\section{root inline}\label{sec:root-inline}
$\sqrt{2}$
@muzimuzhi
Copy link
Contributor

muzimuzhi commented Nov 1, 2024

What do you meant "hidden files", .aux files? Or sub files loaded by the root one?

@octaeder
Copy link
Contributor Author

octaeder commented Nov 1, 2024

txs scans the document tree (included files) beginning from the root (depending on options set). The root is an open file, maybe you have opened other included files. All other files are opened by txs as hidden files. You can open a list of opened files as well as a list of hidden files:

image

@dbitouze
Copy link
Contributor

dbitouze commented Nov 1, 2024

How to reproduce

@octaeder BTW, when you want to provide an example of a main file and one or several subfiles, you can do that as a self content file thanks to the filecontents environment:

\begin{filecontents}[overwrite]{a1.tex}
\section{root inline}\label{sec:root-inline}
$\sqrt{2}$
\end{filecontents}

\documentclass{article}
\begin{document}
\input{a1}
$\sqrt{2}$\ref{sec:root-inline}
\end{document}

@octaeder
Copy link
Contributor Author

octaeder commented Nov 1, 2024

@dbitouze Nice feature, but obviously this is one file for txs and hence there is no hidden file.

@octaeder
Copy link
Contributor Author

octaeder commented Nov 3, 2024

I think this is fixed with yesterdays commits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants