File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -97,9 +97,14 @@ If enabled, dwm maps control keys to the commands.
9797
9898 *'g:dwm_master_pane_width'*
9999Default: ?
100- Set the width of the master pane.
100+ Set the width of the master pane. If the value is given as a string, the width
101+ will be set to a relative percentage of the editor's width.
101102>
103+ "set master pane width to 85 columns
102104 let g:dwm_master_pane_width=85
105+
106+ "set master pane width to 66% of editor width
107+ let g:dwm_master_pane_width="66%"
103108<
104109
105110
Original file line number Diff line number Diff line change @@ -102,7 +102,11 @@ endfunction
102102function DWM_ResizeMasterPaneWidth ()
103103 " resize the master pane if user defined it
104104 if exists (' g:dwm_master_pane_width' )
105- exec ' vertical resize ' . g: dwm_master_pane_width
105+ if type (g: dwm_master_pane_width ) == type (" " )
106+ exec ' vertical resize ' . ((str2nr (g: dwm_master_pane_width )* &columns )/100 )
107+ else
108+ exec ' vertical resize ' . g: dwm_master_pane_width
109+ endif
106110 endif
107111endfunction
108112
You can’t perform that action at this time.
0 commit comments