diff --git a/extra/editors/gvim/gvim.factor b/extra/editors/gvim/gvim.factor index 024f5cfffa..802ab51c7a 100644 --- a/extra/editors/gvim/gvim.factor +++ b/extra/editors/gvim/gvim.factor @@ -1,10 +1,18 @@ -USING: kernel math math.parser namespaces editors.vim ; +USING: io.backend io.files kernel math math.parser +namespaces editors.vim sequences system windows.shell32 ; IN: editors.gvim TUPLE: gvim ; +HOOK: gvim-path io-backend ( -- path ) + + M: gvim vim-command ( file line -- string ) - [ "\"" % vim-path get % "\" \"" % swap % "\" +" % # ] "" make ; + [ "\"" % gvim-path % "\" \"" % swap % "\" +" % # ] "" make ; + +t vim-detach set-global ! don't block the ui T{ gvim } vim-editor set-global -"gvim" vim-path set-global + +USE-IF: unix? editors.gvim.unix +USE-IF: windows? editors.gvim.windows diff --git a/extra/editors/gvim/unix/unix.factor b/extra/editors/gvim/unix/unix.factor new file mode 100644 index 0000000000..fd295cc9e9 --- /dev/null +++ b/extra/editors/gvim/unix/unix.factor @@ -0,0 +1,7 @@ +USING: editors.gvim io.unix.backend kernel namespaces ; +IN: editors.gvim.unix + +M: unix-io gvim-path + \ gvim-path get-global [ + "gvim" + ] unless* ; diff --git a/extra/editors/gvim/windows/windows.factor b/extra/editors/gvim/windows/windows.factor new file mode 100644 index 0000000000..5a3ea6b67a --- /dev/null +++ b/extra/editors/gvim/windows/windows.factor @@ -0,0 +1,8 @@ +USING: editors.gvim io.files io.windows kernel namespaces +sequences windows.shell32 ; +IN: editors.gvim.windows + +M: windows-io gvim-path + \ gvim-path get-global [ + program-files walk-dir [ "gvim.exe" tail? ] find nip + ] unless* ;