Commits

ZyX_I  committed 85079db

Added readable aurum://… description property

  • Participants
  • Parent commits 74060ce

Comments (0)

Files changed (3)

File autoload/aurum/commit.vim

 let s:_messages={
             \'emptmsg': 'Message must contain at least one non-blank character',
             \'nocfile': 'Unsure what should be commited',
-            \'nocread': 'Cannot read aurum://commit',
             \  'nocom': 'Nothing to commit',
         \}
 let s:_options={
             \  'listargs': 1,
             \'modifiable': 1,
             \  'filetype': 'aurumcommit',
+            \  'readable': 0,
             \}
 function s:F.bufleave()
     let bvar=s:_r.bufvars[+expand('<abuf>')]
     endif
 endfunction
 function s:commit.function(read, repo, user, date, cb, files)
-    if a:read
-        call s:_f.throw('nocread')
-    endif
     augroup AuCommit
         autocmd! BufLeave <buffer> :call s:F.bufleave()
     augroup END

File autoload/aurum/edit.vim

 "▶1
 scriptencoding utf-8
-execute frawor#Setup('1.5', {'@/resources': '0.0',
+execute frawor#Setup('1.6', {'@/resources': '0.0',
             \                       '@/os': '0.0',
             \                '@/functions': '0.1',
             \               '@%aurum/repo': '5.0',
             \    'ucmd': 'Unknown command: %s',
             \     'nwr': 'Write feature is not implemented for command %s',
             \'nosource': 'Can not source %s',
+            \  'noread': 'Can not read %s',
             \   'nrepo': 'No repository found for path %s',
         \}
 call extend(s:_messages, map({
     "▶2 Check SourceCmd support
     if a:rw==2 && !get(cdescr, 'sourceable', 0)
         call s:_f.throw('nosource', amatch)
+    elseif a:rw==1 && !get(cdescr, 'readable', 1)
+        call s:_f.throw('noread', amatch)
     endif
     "▲2
     let arguments=get(cdescr, 'arguments', 0)
         endif
         let cdescr[key]=a:cdescr[key]
     endfor
-    "▶2 Boolean keys: modifiable, sourceable, requiresbvar
-    for key in ['modifiable', 'sourceable', 'requiresbvar']
+    "▶2 Boolean keys: modifiable, sourceable, readable, requiresbvar
+    for key in ['modifiable', 'sourceable', 'readable', 'requiresbvar']
         if has_key(a:cdescr, key)
             if type(a:cdescr[key])!=type(0)
                 call s:_f.throw('nbl')

File doc/aurum.txt

     1.3: Added prevbuf function.
     1.4: Added “plstrgen” _f.newcommand option.
     1.5: Added possibility to use custom writer function for aurum://edit
+    1.6: Added “readable” setting.
 @%aurum/vimdiff:
     0.1: Added full, untracked, onlymodified and files options to |:AuVimDiff|
     0.2: Added _r.vimdiff.full.