summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/api/commands.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/ranger/api/commands.py b/ranger/api/commands.py
index 73975adc..ca3f730d 100644
--- a/ranger/api/commands.py
+++ b/ranger/api/commands.py
@@ -48,13 +48,14 @@ class CommandContainer(object):
 	def get_command(self, name, abbrev=True):
 		if abbrev:
 			lst = [cls for cmd, cls in self.commands.items() \
-					if cmd.startswith(name) \
-					and cls.allow_abbrev \
+					if cls.allow_abbrev and cmd.startswith(name) \
 					or cmd == name]
 			if len(lst) == 0:
 				raise KeyError
-			if len(lst) == 1 or self.commands[name] in lst:
+			if len(lst) == 1:
 				return lst[0]
+			if self.commands[name] in lst:
+				return self.commands[name]
 			raise ValueError("Ambiguous command")
 		else:
 			try:
k K. Agaram <vc@akkartik.com> 2014-11-24 21:09:07 -0800 committer Kartik K. Agaram <vc@akkartik.com> 2014-11-24 21:12:23 -0800 314 - better syntax for functions' href='/akkartik/mu/commit/edit.arc.t?h=hlt&id=cb9e66d70b86909dc811182479253a78cfbead07'>cb9e66d7 ^
0ca35d02 ^
d4b4d018 ^
cb9e66d7 ^
239328e4 ^

484d7648 ^














9dca5395 ^

4f9f75dd ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
                                       
                          

            

       
                        

                             
                               
                                                                 
         

                                  














                                                                                                        

       

                                    
(selective-load "mu.arc" section-level)
(set allow-raw-addresses*)

(section 100

(reset)
(new-trace "new-screen")
(add-code:readfile "edit.mu")
(add-code
  '((function test-new-screen [
      (1:screen-address/global <- new-screen 5:literal 5:literal)
     ])))
;? (each stmt function*!new-screen
;?   (prn stmt))
(let routine make-routine!test-new-screen
  (let before rep.routine!alloc
;?     (= dump-trace* (obj blacklist '("sz" "m" "setm" "addr" "cvt0" "cvt1")))
    (run 'test-new-screen)
;?     (prn memory*)
;?     (prn memory*.2001)
    (when (~is (memory* memory*.1) 5)  ; number of rows
      (prn "F - newly-allocated screen doesn't have the right number of rows: @(memory* memory*!2001)"))
    (let row-pointers (let base (+ 1 memory*.1)
                        (range base (+ base 4)))
  ;?     (prn row-pointers)
      (when (some nil (map memory* row-pointers))
        (prn "F - newly-allocated screen didn't initialize all of its row pointers"))
      (when (~all 5 (map memory* (map memory* row-pointers)))
        (prn "F - newly-allocated screen didn't initialize all of its row lengths")))))

(reset)

)  ; section 100 for all editor code