History

auto_profiles.lua: don't warn if profile-restore=default

The code assumed that the value of the profile-restore field is "default" for such profiles, but the C implementation is such that the field is intentionally omitted in such case. This resulted in incorrectly trying to restore such profiles. However, there are no stored values with profile-restore=default, so it only resulted in a harmless warning, but otherwise behaved correctly (i.e. nothing is restored). Fix the condition by taking into account that missing field means "default", so that it doesn't try to restore in such case, and avoid the warning.

CogentRedTester committed 4 years ago

Commit 712ef651 parent 9fd92391 file · +1 −1Browse files

Showing the changes to player/lua/auto_profiles.lua (1 of 1 file). Show all

Unified · Split

player/lua/auto_profiles.lua+1−1
@@ -163,7 +163,7 @@ local function load_profiles() · 162 unmodified lines
163 properties = {},163 properties = {},
164 status = nil,164 status = nil,
165 dirty = true, -- need re-evaluate165 dirty = true, -- need re-evaluate
166 has_restore_opt = v["profile-restore"] ~= "default"166 has_restore_opt = v["profile-restore"] and v["profile-restore"] ~= "default"
167 }167 }
168 profiles[#profiles + 1] = profile168 profiles[#profiles + 1] = profile
169 have_dirty_profiles = true169 have_dirty_profiles = true

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t