You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running BeautifyRust in a tab that has no file name (an unsaved tab with Rust syntax) raises a TypeError. Sublime Text build 4215, Windows 11, tested with v0.3.0 and with a copy of master (same code).
run does self.filename = self.view.file_name() and then os.path.basename(self.filename); file_name() is None for an unsaved tab. Console:
File ".../BeautifyRust.py", line 33, in run
self.fname = os.path.basename(self.filename)
TypeError: expected str, bytes or os.PathLike object, not NoneType
Fix I tested, in a folder copy of master: right after self.filename = self.view.file_name() add
ifnotself.filename:
returnsublime.status_message("Beautify rust: save the file first.")
With it the same command in the same tab prints no error.
Activity