Browse Source

adding features

master
lolson 9 years ago
parent
commit
20423c08f4
1 changed files with 6 additions and 3 deletions
  1. +6
    -3
      plugin/makecols.vim

+ 6
- 3
plugin/makecols.vim View File

@ -101,15 +101,17 @@ function! s:replace_selected_text(converted_text)
let @z = a:converted_text let @z = a:converted_text
execute "normal! \"zP" execute "normal! \"zP"
echom "Just replaced the selection." echom "Just replaced the selection."
unlet @z
let @z = ""
return "" return ""
endfunction endfunction
function! s:makecols(orient, cols) range function! s:makecols(orient, cols) range
" backup the globals
let default_orientation = g:makecols_orientation let default_orientation = g:makecols_orientation
let default_cols = g:makecols_cols let default_cols = g:makecols_cols
let g:makecols_orientation = a:orient let g:makecols_orientation = a:orient
if (v:count > 0) if (v:count > 0)
let g:makecols_cols = v:count let g:makecols_cols = v:count
@ -119,20 +121,21 @@ function! s:makecols(orient, cols) range
echom "Orientation: " . g:makecols_orientation echom "Orientation: " . g:makecols_orientation
echom "Number of Columns: " . g:makecols_cols echom "Number of Columns: " . g:makecols_cols
let mode = visualmode() let mode = visualmode()
if (mode !=# "V") if (mode !=# "V")
echo "You must be in linewise visual mode" echo "You must be in linewise visual mode"
return s:beep() return s:beep()
else else
echo "You are in the right mode" echo "You are in the right mode"
endif endif
let converted_text = s:convert_selection() let converted_text = s:convert_selection()
s:replace_selected_text(converted_text)
let g:makecols_orientation = default_orientation let g:makecols_orientation = default_orientation
let g:makecols_cols = default_cols let g:makecols_cols = default_cols
s:replace_selected_text(converted_text)
return "" return ""
endfunction endfunction

Loading…
Cancel
Save