Commits

ZyX_I committed 33ad0f6

ftplugin/aurumlog: Fix yet another “map() modifies original list” issue

  • Participants
  • Parent commits 3690fb9

Comments (0)

Files changed (1)

File ftplugin/aurumlog.vim

             if has_key(bvar.opts, 'files') &&
                         \!has_key(bvar.opts.ignorefiles, 'open')
                 let files=copy(bvar.opts.csfiles[hex])
-                call filter(files, 'index(cs[fileskey], v:val)!=-1')
+                if fileskey is# 'files'
+                    call filter(files, 'index(cs.files, v:val)!=-1')
+                endif
                 if empty(files)
                     call s:_f.throw('novfilesff', hex)
                 endif
             else
-                let files=copy(cs[fileskey])
+                let files=cs[fileskey]
                 if empty(files)
                     call s:_f.throw('novfiles', hex)
                 endif
             endif
             let choice=inputlist(['Select file (0 to cancel):']+
-                        \        map(files, '(v:key+1).". ".v:val'))
+                        \        map(copy(files), '(v:key+1).". ".v:val'))
             if choice
                 let file=files[choice-1]
             endif