]> git.gir.st - VimFx.git/commit
Use Huffman algorithm for hints generation (fix #112)
authorSimon Lydell <simon.lydell@gmail.com>
Tue, 16 Jul 2013 09:31:50 +0000 (11:31 +0200)
committerSimon Lydell <simon.lydell@gmail.com>
Tue, 16 Jul 2013 12:10:08 +0000 (14:10 +0200)
commitef1d5aa0aceb28fcf5681717de16f163bd02feab
tree24d68108bd38eca46108b960c21ed0eee4ff847a
parentc2e530cebb6d75340013f91e3a88f67ca353a95e
Use Huffman algorithm for hints generation (fix #112)

The Huffman algorithm is now used to generate optimal prefix codes for all
focusable elements. The area of each element is used as _weight_. The
higher the weight, the shorter the hint.

Note:

The old algorithm seemed to give shorter hints to `<a>` elements. That is
currently not the case with the new algorithm.

Other related changes:

- Change minimum allowed number of hint chars from 3 to 2, since the new
  algorithm supports it.
- Change default hint chars, since with the new algorithm the best keys
  should be at the beginning of the string.
- My editor is set to strip trailing white space. Apparently there was a
  lot of trailing whitespace in many files, so a diff of this commit is a
  bit messy.
extension/locale/en-US/options.dtd
extension/locale/hu-HU/options.dtd
extension/locale/hu/options.dtd
extension/locale/pl/options.dtd
extension/locale/ru/options.dtd
extension/locale/zh-CN/options.dtd
extension/packages/events.coffee
extension/packages/huffman.coffee [new file with mode: 0644]
extension/packages/marker.coffee
extension/packages/prefs.coffee
extension/packages/utils.coffee
Imprint / Impressum