Skip to content

Commit

Permalink
Ensure the name type is set when a new target is loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 authored Jan 3, 2025
1 parent 14d8e8f commit 1b944df
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions gui/rename.lua
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,12 @@ function Rename:init(info)
self.sync_targets = info.sync_targets or {}
self.cache = {}

if self.target.type == df.language_name_type.NONE then
self.target.type = df.language_name_type.Figure
local function normalize_name()
if self.target.type == df.language_name_type.NONE then
self.target.type = df.language_name_type.Figure
end
end
normalize_name()

local language_options, max_lang_name_width = get_language_options()

Expand All @@ -285,6 +288,7 @@ function Rename:init(info)
select_new_target(function(target, sync_targets)
if not target then return end
self.target, self.sync_targets = target, sync_targets or {}
normalize_name()
self.subviews.language:setOption(self.target.language)
end)
end,
Expand Down

0 comments on commit 1b944df

Please sign in to comment.