From d63bcda89712f2109ef5738d1a04ac8f6d06b3b8 Mon Sep 17 00:00:00 2001 From: Serpent7776 Date: Thu, 3 Aug 2023 21:15:45 +0200 Subject: [PATCH 1/4] Use local var asm to store generated assembly Also remove -o option, as it's not needed. --- plugin/dumpx.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/dumpx.vim b/plugin/dumpx.vim index c8cb321..bf56c73 100644 --- a/plugin/dumpx.vim +++ b/plugin/dumpx.vim @@ -50,7 +50,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 @@ -63,7 +63,7 @@ function! DumpX(where) endif setlocal buftype=nofile bufhidden=hide noswapfile normal! G - execute "put a" + execute "put =l:asm" setf dumpx From 99581abc2e297e25ee3b75877043e02894ec0bc1 Mon Sep 17 00:00:00 2001 From: Serpent7776 Date: Thu, 3 Aug 2023 21:17:42 +0200 Subject: [PATCH 2/4] Minor cleanups --- plugin/dumpx.vim | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugin/dumpx.vim b/plugin/dumpx.vim index bf56c73..c9e0713 100644 --- a/plugin/dumpx.vim +++ b/plugin/dumpx.vim @@ -62,14 +62,12 @@ function! DumpX(where) new endif setlocal buftype=nofile bufhidden=hide noswapfile - normal! G 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 From 639ba7543b1f1406214471b7acf081affbfd82c6 Mon Sep 17 00:00:00 2001 From: Serpent7776 Date: Thu, 3 Aug 2023 21:18:17 +0200 Subject: [PATCH 3/4] Remove YCM stuff It references nonexistent, hard-coded path. Remove it, as it's not working anyway. --- plugin/dumpx.vim | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/plugin/dumpx.vim b/plugin/dumpx.vim index c9e0713..ee18d93 100644 --- a/plugin/dumpx.vim +++ b/plugin/dumpx.vim @@ -21,10 +21,6 @@ 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 @@ -32,10 +28,6 @@ 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('.') @@ -82,7 +74,3 @@ command DumpXRight :call DumpX('right') command DXR :call DumpX('right') command DumpXLeft :call DumpX('left') command DXL :call DumpX('left') -command DXAF :call DumpXAutoFlags() - - - From 0cd244ec38eba0484de1c98039961d26d5e9581f Mon Sep 17 00:00:00 2001 From: Serpent7776 Date: Thu, 3 Aug 2023 21:19:21 +0200 Subject: [PATCH 4/4] Add :DX command Intended as: open new window anywhere. --- plugin/dumpx.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin/dumpx.vim b/plugin/dumpx.vim index ee18d93..ce0a58f 100644 --- a/plugin/dumpx.vim +++ b/plugin/dumpx.vim @@ -74,3 +74,4 @@ command DumpXRight :call DumpX('right') command DXR :call DumpX('right') command DumpXLeft :call DumpX('left') command DXL :call DumpX('left') +command DX :call DumpX('')