Project

Profile

Help

Revision d4d4e7dd

Added by Michael Kay about 1 year ago

Further fix for bug #4488

View differences:

latest10/hej/net/sf/saxon/Gizmo.java
173 173
        config = Configuration.newConfiguration();
174 174
        config.setConfigurationProperty(Feature.ALLOW_SYNTAX_EXTENSIONS, true);
175 175
        env = new IndependentContext(config);
176
        InputStream commandInput = System.in;
177 176
        String source = null;
178 177
        String script = null;
179 178
        boolean interactive = true;
......
188 187
        }
189 188
        talker = initTalker(script);
190 189
        //System.err.println("Using term=" + talker.getClass().getCanonicalName());
190

  
191
        List<String> sortedNames = new ArrayList<>(Arrays.asList(keywords));
192
        Collections.sort(sortedNames);
193
        talker.setAutoCompletion(sortedNames);
191 194
        
192 195
        if (source != null) {
193 196
            try {
......
210 213
                System.exit(2);
211 214
            }
212 215
        }
213
        if (script != null) {
214
            try {
215
                commandInput = new FileInputStream(new File(script));
216
                interactive = false;
217
            } catch (FileNotFoundException e) {
218
                System.out.println("Cannot read script file " + script + ": " + e.getMessage());
219
            }
220
        }
221

  
222 216

  
223 217
        env.declareNamespace("xml", NamespaceConstant.XML);
224 218
        env.declareNamespace("xsl", NamespaceConstant.XSLT);
latest10/hej/net/sf/saxon/gizmo/JLine2Talker.java
52 52
    @Override
53 53
    public String exchange(String message) {
54 54
        try {
55
            if (DEBUG) {
56
                console.println(debugLog);
57
                debugLog.setLength(0);
58
            }
55 59
            if (message != null && !message.isEmpty()) {
56 60
                console.println(message);
57 61
            }

Also available in: Unified diff