1. ZyX_I
  2. frawor


ZyX_I  committed ca75239

@/functions: Make decsort never return 0 (sort alphabetically if priority is equal)

  • Participants
  • Parent commits f5acae8
  • Branches default

Comments (0)

Files changed (2)

File doc/frawor.txt

View file
  • Ignore whitespace
         must only be used to make error messages more verbose) and an argument 
         (value of `@{decid}' key) and return a tuple of five values:
         1. priority (any number). Decorators with higher priority will be put 
-           less close to return statement;
+           less close to return statement, if priority is equal decorators' 
+           names are taken into account;
         2. arguments variable name (return `@@@' to leave it unchanged);
         3. private decorator variable (0 if not used);
         4. a list of lines that are to be put before |:return| statement 

File plugin/frawor/functions.vim

View file
  • Ignore whitespace
     let b=a:b[2]
     if a==b
         call s:_f.warn('deceqpri', a:a[0], a:b[0])
+        return ((sort([a:a[0], a:b[0]]) is a:a[0])?(-1):(1))
-    return ((a>b)?(-1):((a<b)?(1):(0)))
+    return ((a>b)?(-1):(1))
 let s:_functions['s:Decsort']=function('s:Decsort')
 "▶1 beatycode       :: function::[String] → function::[String]