ZyX_I avatar ZyX_I committed 40a6a33

@aurum/record: Fixed recording executable files

Comments (0)

Files changed (1)


     let bvar.getwnrs=s:F.getwnrs
     let bvar.recrunmap=s:F.runstatmap
     let bvar.write=s:F.write
-    let bvar.savedundolevels=&undolevels
+    let bvar.savedopts={'undolevels': &undolevels,
+                \        'scrollopt': &scrollopt,
+                \        'autowrite': &autowrite,
+                \     'autowriteall': &autowriteall,
+                \         'autoread': &autoread,}
+    setglobal noautowrite noautowriteall noautoread
     if !bvar.startundo
         setglobal undolevels=-1
 "▶1 unload
 function s:F.unload(bvar)
     let sbvar=get(a:bvar, 'sbvar', a:bvar)
-    let &g:undolevels=sbvar.savedundolevels
+    for [o, val] in items(sbvar.savedopts)
+        execute 'let &g:'.o.'=val'
+    endfor
     if bufexists(sbvar.bufnr)
         call setbufvar(sbvar.bufnr, '&modified', 0)
                 silent write
                 if isexe && s:_r.os.name is# 'posix'
-                    call s:_r.os.run(['chmod', '+x', fullpath])
+                    call system('chmod +x '.fnameescape(fullpath))
             if !has_key(s:_r.bufvars, bufnr('%'))
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.