ZyX_I  committed 5cc53c3

ftplugin/aurumstatus: Added aurum_statwincmd option

  • Participants
  • Parent commits 9eb9d12

Comments (0)

Files changed (3)

File README.markdown

   - Viewing working directory status ([:AuStatus](
   - Commiting changes ([:AuCommit](, commit messages are remembered in case of 
-    rollback ([g:aurum_remembermsg](
+    rollback ([g:aurum_remembermsg](
   - Obtaining various URL’s out of remote repository URL (like URL of the HTML 
     version of the current file with URL fragment pointing to the current line 

File doc/aurum.txt

     arguments should use existing status window or open a new one.
     Default: 1.
+statwincmd                                                *g:aurum_statwincmd*
+    String, one of “j”, “k”, “h”, “l”, “w”, “W”, “t”, “b”, “p”, “c”.
+    Determines what window should be switched to when running |aurum://status| 
+    mappings. See |window-move-cursor| for the description of most keys.
+    No error will be given if there is no window in desired direction, 
+    mappings will just use status buffer’s own window.
+    Value “c” is special: window will be |:close|d and cursor will be moved to 
+    whatever window vim selects. In other cases status window won’t be closed.
+    Ignored if there is only one window left.
+    Default: “c”.
 remembermsg                                              *g:aurum_remembermsg*
     Bool. Determines whether message typed in commit buffer should be saved 
     when commit is performed in case of rollback. This message will appear in 

File ftplugin/aurumstatus.vim

             \                   '@%aurum/edit': '1.2',
             \                 '@%aurum/commit': '1.0',
             \                     '@/mappings': '0.0',
+            \                      '@/options': '0.0',
             \                           '@/os': '0.0',})
 let s:_messages={
             \  'nopars': 'Revision %s has no parents',
+let s:_oprefix='aurum'
+let s:_options={
+            \'statwincmd': {'default': 'c',
+            \               'checker': 'match /\v^[jkhlwWtbpc]$/'},
+        \}
 "▶1 runmap
 let s:noacttypes={
             \    'open': ['deleted'],
         if isrecord
             let [lwnr, rwnr, swnr]=bvar.getwnrs()
             execute lwnr.'wincmd w'
-        else
-            wincmd c
+        elseif winnr('$')>1
+            execute 'wincmd' s:_f.getoption('statwincmd')
     if a:action is# 'open'