[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    have compare in indenter api
From:       Leo Savernik <l.savernik () aon ! at>
Date:       2008-05-27 18:46:33
Message-ID: 200805272046.34993.l.savernik () aon ! at
[Download RAW message or body]

Am Montag, 26. Mai 2008 schrieb Robin Pedersen:
> +// Helper function to compare two KTextEditor::Cursor objects.
> +// Returns 0 if equal, 1 if ca > cb, -1 if ca < cb
> +function compare(ca, cb)
> +{
> +  if (ca.line == cb.line) {
> +    if (ca.column == cb.column)
> +      return 0;
> +    else
> +      return (ca.column > cb.column) ? 1 : -1;
> +  }
> +  return (ca.line > cb.line) ? 1 : -1;
> +}

I'd like to suggest to provide a built-in compare function for cursors in 
indenter scripts (called compare for simplicity). The ruby indenter is the 
first but certainly not the last one in need of such a primitive.

mfg
	Leo
_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic