diff options
author | Dalai Felinto <dalai@blender.org> | 2021-11-25 20:00:33 +0300 |
---|---|---|
committer | Dalai Felinto <dalai@blender.org> | 2021-11-25 20:00:33 +0300 |
commit | e3d3296327e9b4d97141e46707b5565246b22982 (patch) | |
tree | 55e27fc6c184f4f50c7de9f8176abda093033a4f /source | |
parent | 4a3f99ad5a2e6e87156baa5c6f2184df8ea09683 (diff) | |
parent | e6a41e1c806b318eaa866fdc2a100c4e7fedfb15 (diff) |
Merge remote-tracking branch 'origin/blender-v3.0-release'
Merge conflict: Makes sure master is still alpha, while 3.0 is rc.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_file/filesel.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index c59398e0016..37b1d3825d4 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -1372,7 +1372,7 @@ void file_params_renamefile_activate(SpaceFile *sfile, FileSelectParams *params) BLI_assert(params->renamefile[0] != '\0' || params->rename_id != NULL); - const int idx = file_params_find_renamed(params, sfile->files); + int idx = file_params_find_renamed(params, sfile->files); if (idx >= 0) { FileDirEntry *file = filelist_file(sfile->files, idx); BLI_assert(file != NULL); @@ -1385,7 +1385,11 @@ void file_params_renamefile_activate(SpaceFile *sfile, FileSelectParams *params) params->rename_flag = FILE_PARAMS_RENAME_ACTIVE; } else if ((params->rename_flag & FILE_PARAMS_RENAME_POSTSCROLL_PENDING) != 0) { + /* file_select_deselect_all() will resort and refilter, so idx will probably have changed. + * Need to get the correct FileDirEntry again. */ file_select_deselect_all(sfile, FILE_SEL_SELECTED); + idx = file_params_find_renamed(params, sfile->files); + file = filelist_file(sfile->files, idx); filelist_entry_select_set( sfile->files, file, FILE_SEL_ADD, FILE_SEL_SELECTED | FILE_SEL_HIGHLIGHTED, CHECK_ALL); params->active_file = idx; |