onivim / oni

Oni: Modern Modal Editing - powered by Neovim
https://www.onivim.io
MIT License
11.35k stars 299 forks source link

Feature/remeasure window on commandline hide and show #2614

Closed akinsho closed 5 years ago

akinsho commented 6 years ago

This relates to #2612, the commandline can cause the window/viewport to be repositioned if inccommand is enabled and so the window will shift to the next available match if this is off screen the window will reposition but this isn't passed on to the buffer layer render context so things like the indent lines remain incorrectly placed.

This change causes the window to remeasure when this changes (the observable is essentially already throttled using distinctUntil so don't think this should cause a performance issue as it will remeasure if the context changes i.e. if a reposition occurred.

Unfortunately there isn't a more specific event to hook into if the window moves

This solves the issue of incorrectly placed buffer layer elements whilst searching using / inside a file

codecov[bot] commented 6 years ago

Codecov Report

Merging #2614 into master will decrease coverage by 0.01%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2614      +/-   ##
==========================================
- Coverage    45.3%   45.28%   -0.02%     
==========================================
  Files         361      361              
  Lines       14571    14577       +6     
  Branches     1912     1912              
==========================================
  Hits         6601     6601              
- Misses       7746     7752       +6     
  Partials      224      224
Impacted Files Coverage Δ
browser/src/neovim/NeovimWindowManager.ts 10.61% <0%> (-0.6%) :arrow_down:

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 d354c2c...4e46ef2. Read the comment docs.