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

Fix reloading file with axis #2762

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/emc/usr_intf/axis/scripts/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1895,14 +1895,15 @@ def run_warn():
return 0

def reload_file(refilter=True):
global loaded_file
if running(): return
s.poll()
if not loaded_file:
root_window.tk.call("set_mode_from_tab")
return
line = vars.highlight_line.get()
o.set_highlight_line(None)

orig_loaded_file = loaded_file
if refilter or not get_filter(loaded_file):
# we copy the file to a temporary file so that even if it subsequently
# changes on disk, LinuxCNC is parsing the file contents from the time
Expand All @@ -1913,6 +1914,7 @@ def reload_file(refilter=True):
else:
tempfile = os.path.join(tempdir, "filtered-" + os.path.basename(loaded_file))
open_file_guts(tempfile, True, False)
loaded_file = orig_loaded_file
if line:
o.set_highlight_line(line)

Expand Down
Loading