Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 5 additions & 18 deletions plugin/dumpx.vim
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,13 @@ if !exists('g:dumpxCFLAGS')
let g:dumpxCFLAGS = ''
endif

if !exists('g:dumpxYCM')
let g:dumpxYCM='default'
endif

"mode 0 == only assembly
"mode 1 == mix C and assembly and jump
"mode 2 == only assembly current line of source
if !exists('g:dumpxMode')
let g:dumpxMode = 1
endif

function! DumpXAutoFlags()
let g:dumpxCFLAGS = system('~/.vim/bundle/dumpx/plugin/autoycm.pl ' . g:dumpxYCM)
endfunction

"create new window and puts mix C code and assembly, go to current line
function! DumpX(where)
let l:cbl=line('.')
Expand All @@ -50,7 +42,7 @@ function! DumpX(where)
let l:filter = " | awk '/[ \t]*" . l:cbl . ":[a-zA-Z0-9_\/]*/{flag=1;next}/[ \t]*" . l:ncbl . ":[a-zA-Z0-9_\/]*/{flag=0}flag'"
endif

let @a = system( g:dumpxCC . ' -g ' . g:dumpxCFLAGS . ' -Wa,' . l:asmode . ' -c ' . expand('%:p') . ' -o /tmp/vim.dumpx.' . expand('%') . l:filter)
let l:asm = system( g:dumpxCC . ' -g ' . g:dumpxCFLAGS . ' -Wa,' . l:asmode . ' -c ' . expand('%:p') . l:filter)

if a:where ==# "down"
below new
Expand All @@ -62,14 +54,12 @@ function! DumpX(where)
new
endif
setlocal buftype=nofile bufhidden=hide noswapfile
normal! G
execute "put a"
execute "put =l:asm"
1d

setf dumpx

"call cursor(1,1)

if g:dumpxMode == 1
if g:dumpxMode == 2
execute '?[ \t]*' . l:cbl . ':[a-zA-Z0-9_\/]*' . expand('%') . '/'
normal! zt
endif
Expand All @@ -84,7 +74,4 @@ command DumpXRight :call DumpX('right')
command DXR :call DumpX('right')
command DumpXLeft :call DumpX('left')
command DXL :call DumpX('left')
command DXAF :call DumpXAutoFlags()



command DX :call DumpX('')