Skip to content
This repository was archived by the owner on Apr 1, 2020. It is now read-only.

Feature/ Indent lines improvements #2446

Merged
merged 17 commits into from
Jul 25, 2018
Merged

Conversation

akinsho
Copy link
Member

@akinsho akinsho commented Jul 22, 2018

As mentioned in #2344 buffer layers suffer from laggy rendering on scroll, on some investigation it seems the auditTime we use in the shouldMeasure$ observable means that the information is not being updated in real time so scrolling quickly through a buffer causes indentlines or color highlights to appear in a janky fashion i.e. they are out of place.

Not sure what it was used for but I think because the information is required by ui pieces which need v. up to date data re window details we should allow things to be updated as often possible. This change greatly improves the rendering.

There are a couple of things which still cause the ui to be a bit janky:

  • one is the initial buffer entering although this is arguably low priority 🤷‍♂️ - seems quite a lot happens there the first time and rendering is noticeably slower.
  • folding is completely unhandled (not investigated yet)
  • double line wrapping
  • searching in a buffer which can change the position of the window doesn't seem to update the window positioning (any ideas @bryphe?) - i.e. searching in buffer with ? or / can move the viewport towards the match(es) in this case window details passed to context don't seem to update
  • initial load of a buffer similar to one

Other additions:

  • I also tweaked the indent lines to use a bannedFiletypes buffer as opposed to a whitelist aka as discussed with @CrossR it is now on for all filetypes except those which are blacklisted. @CrossR examples of where you would want a black list I think would be most vim plugin buffers like peekabo or startify or nerdtree etc. in these cases the indentlines rarely render desirably and are arguably not required.

  • I render the first indent line which is the same behaviour as in vscode however i've added an option. experimental.indentLines.skipFirst which allows a user to avoid this behaviour if they would prefer

@akinsho akinsho force-pushed the bugfix/scroll-lag branch from e8f6a8a to 59cdfaa Compare July 22, 2018 14:06
@akinsho akinsho changed the title Bugfix/buffer layer scroll lag Bugfix/buffer layer scroll lag and use render first indent line optionally Jul 22, 2018
@akinsho akinsho changed the title Bugfix/buffer layer scroll lag and use render first indent line optionally Bugfix/buffer layer scroll lag and render first indent line optionally Jul 22, 2018
@akinsho akinsho changed the title Bugfix/buffer layer scroll lag and render first indent line optionally Feature/ Indent lines improvements Jul 22, 2018
@codecov
Copy link

codecov bot commented Jul 22, 2018

Codecov Report

Merging #2446 into master will increase coverage by 0.1%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #2446     +/-   ##
=========================================
+ Coverage   42.62%   42.72%   +0.1%     
=========================================
  Files         332      332             
  Lines       13212    13209      -3     
  Branches     1736     1736             
=========================================
+ Hits         5632     5644     +12     
+ Misses       7302     7287     -15     
  Partials      278      278
Impacted Files Coverage Δ
...src/Services/Configuration/DefaultConfiguration.ts 87.5% <ø> (ø) ⬆️
browser/src/neovim/NeovimWindowManager.ts 10.81% <0%> (+0.19%) ⬆️
...src/Editor/NeovimEditor/NeovimBufferLayersView.tsx 80% <100%> (+35.55%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4ce7b50...cc2028b. Read the comment docs.

Copy link
Member

@CrossR CrossR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes look good, and from a quick test of jumping around a file, I wasn't able to get any UI issues on scroll like before.

@akinsho akinsho merged commit c465082 into onivim:master Jul 25, 2018
@akinsho akinsho deleted the bugfix/scroll-lag branch July 25, 2018 22:30
@akinsho akinsho restored the bugfix/scroll-lag branch October 1, 2018 09:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants