]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/editors/vim/vim.factor
editors: adding EDITOR: syntax and use classes instead of tuples
[factor.git] / basis / editors / vim / vim.factor
index 39d20c41d1bb0efc7b326a96b10761585d73effb..e44d80b70982497774cd4f48daa42dd67cf1305a 100644 (file)
@@ -2,9 +2,13 @@ USING: editors io.standard-paths kernel make math.parser
 namespaces sequences strings ;
 IN: editors.vim
 
-TUPLE: vim ;
+SINGLETON: vim
 
-editor-class [ T{ vim } ] initialize
+MIXIN: vim-base
+
+INSTANCE: vim vim-base
+
+editor-class [ vim ] initialize
 
 SYMBOL: vim-path
 
@@ -14,14 +18,14 @@ HOOK: vim-ui? editor-class ( -- ? )
 
 SYMBOL: vim-tabs?
 
-M: vim vim-ui? f ;
+M: vim-base vim-ui? f ;
 
-M: vim find-vim-path "vim" ?find-in-path ;
+M: vim-base find-vim-path "vim" ?find-in-path ;
 
 : actual-vim-path ( -- path )
     \ vim-path get [ find-vim-path ] unless* ;
 
-M: vim editor-command
+M: vim-base editor-command
     [
         actual-vim-path dup string? [ , ] [ % ] if
         vim-ui? [ "-g" , ] when
@@ -30,4 +34,4 @@ M: vim editor-command
         ,
     ] { } make ;
 
-M: vim editor-detached? f ;
+M: vim-base editor-detached? f ;