summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@chalmers.se>2008-06-05 12:12:44 +0000
committerkr.angelov <kr.angelov@chalmers.se>2008-06-05 12:12:44 +0000
commitc4d298a347bace37c4fe06fa0e1a4668b92028ed (patch)
tree30066e202c04a25a8d651a7f817f4ffe62b9c7dd
parentabea46022ef35df493a8d78f56f5e9211150c54b (diff)
file name completion for command i
-rw-r--r--src-3.0/GF/System/NoReadline.hs5
-rw-r--r--src-3.0/GF/System/Readline.hs6
-rw-r--r--src-3.0/GF/System/UseReadline.hs2
-rw-r--r--src-3.0/GFI.hs2
4 files changed, 10 insertions, 5 deletions
diff --git a/src-3.0/GF/System/NoReadline.hs b/src-3.0/GF/System/NoReadline.hs
index 564200a3e..1f1050e8c 100644
--- a/src-3.0/GF/System/NoReadline.hs
+++ b/src-3.0/GF/System/NoReadline.hs
@@ -12,7 +12,7 @@
-- Do not use readline.
-----------------------------------------------------------------------------
-module GF.System.NoReadline (fetchCommand, setCompletionFunction) where
+module GF.System.NoReadline (fetchCommand, setCompletionFunction, filenameCompletionFunction) where
import System.IO.Error (try)
import System.IO (stdout,hFlush)
@@ -28,3 +28,6 @@ fetchCommand s = do
setCompletionFunction :: Maybe (String -> String -> Int -> IO [String]) -> IO ()
setCompletionFunction _ = return ()
+
+filenameCompletionFunction :: String -> IO [String]
+filenameCompletionFunction _ = return []
diff --git a/src-3.0/GF/System/Readline.hs b/src-3.0/GF/System/Readline.hs
index 94fca89bd..db122c3e2 100644
--- a/src-3.0/GF/System/Readline.hs
+++ b/src-3.0/GF/System/Readline.hs
@@ -14,14 +14,14 @@
-- Uses the right readline library to read user input.
-----------------------------------------------------------------------------
-module GF.System.Readline (fetchCommand, setCompletionFunction) where
+module GF.System.Readline (fetchCommand, setCompletionFunction, filenameCompletionFunction) where
#ifdef USE_READLINE
-import GF.System.UseReadline (fetchCommand, setCompletionFunction)
+import GF.System.UseReadline
#else
-import GF.System.NoReadline (fetchCommand, setCompletionFunction)
+import GF.System.NoReadline
#endif
diff --git a/src-3.0/GF/System/UseReadline.hs b/src-3.0/GF/System/UseReadline.hs
index 7a4999850..a0e051601 100644
--- a/src-3.0/GF/System/UseReadline.hs
+++ b/src-3.0/GF/System/UseReadline.hs
@@ -12,7 +12,7 @@
-- Use GNU readline
-----------------------------------------------------------------------------
-module GF.System.UseReadline (fetchCommand, setCompletionFunction) where
+module GF.System.UseReadline (fetchCommand, setCompletionFunction, filenameCompletionFunction) where
import System.Console.Readline
diff --git a/src-3.0/GFI.hs b/src-3.0/GFI.hs
index ba26eb667..0a8751c58 100644
--- a/src-3.0/GFI.hs
+++ b/src-3.0/GFI.hs
@@ -133,6 +133,8 @@ wordCompletion cmdEnv line prefix p =
ret (if null flg_compls then ' ' else '=')
(flg_compls++opt_compls)
Nothing -> ret ' ' []
+ CmplIdent (Just (Command "i" _ _)) _ -- HACK: file name completion for command i
+ -> filenameCompletionFunction prefix
CmplIdent _ pref
-> do mb_abs <- try (evaluate (abstract pgf))
case mb_abs of