Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: Broken "g:NERDTreeBookmarksSort" setting fixed. #696

Merged
merged 4 commits into from
May 26, 2017

Commits on May 26, 2017

  1. Apply consistent spacing before fold markers

    The trailing fold markers in "bookmark.vim" varied in how far they were
    from the end of the line. This created an unpleasant visual effect when
    folding was in use.
    Jason Franklin committed May 26, 2017
    Configuration menu
    Copy the full SHA
    519436a View commit details
    Browse the repository at this point in the history
  2. Rename the class method for sorting bookmarks

    A more intention-revealing name was chosen for the script-local sorting
    function. The function comment was also rewritten.
    Jason Franklin committed May 26, 2017
    Configuration menu
    Copy the full SHA
    5aec5ec View commit details
    Browse the repository at this point in the history
  3. Reimplement the bookmark comparison method

    Sorting the list of user bookmarks requires care to ensure that Vim's
    builtin sort function is called correctly. Previously, this function was
    called incorrectly. This is why the sorting of bookmarks never worked.
    
    The offending functions have been removed here and replaced with
    "s:Bookmark.CompareBookmarksByName". To understand the necessity for
    this change, read ":h sort()" for the requirements of the function
    reference argument (esp., note that it must return -1, 0, or 1).
    
    In addition to fixing this problem, the new comparison function will
    inspect the "g:NERDTreeBookmarksSort" setting to determine whether
    case-sensitivity is preferred in the sort. The documentation has been
    modified to accurately reflect this adjustment. The change is also made
    in such a way as not to break any existing configurations.
    
    Fixes preservim#361 ("My bookmarks aren't sorted").
    Jason Franklin committed May 26, 2017
    Configuration menu
    Copy the full SHA
    0b65089 View commit details
    Browse the repository at this point in the history
  4. Remove code duplication from sorting bookmarks

    It makes the most sense to sort the global bookmarks list just before
    rendering them in the NERDTree window. Since Vim's sort function is fast
    and stable, and since users are very unlikely to have a number of
    bookmarks that is too large, we can sort before rendering without
    concern for the negligible performance penalty.
    
    This has two benefits:
      1. Users can change their sort settings and have them take effect
         on the next render or refresh.
      2. As mentioned, code duplication is avoided.
    Jason Franklin committed May 26, 2017
    Configuration menu
    Copy the full SHA
    2a7a375 View commit details
    Browse the repository at this point in the history