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

Conversation

akinsho
Copy link
Member

@akinsho akinsho commented Oct 4, 2018

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

this._neovimInstance.callFunction("line", ["w0"]),
this._neovimInstance.callFunction("line", ["w$"]),
])
const [[topLine, bottomLine]] = await this._neovimInstance.request<[[number, number], any]>(
Copy link
Member Author

Choose a reason for hiding this comment

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

The logic is the same I just swapped this to use the atomic calls api so it works the same way as the call below (also I'm not sure if the atomic calls might be more performant vs. promise.all)

@codecov
Copy link

codecov bot commented Oct 4, 2018

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%) ⬇️

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.

@akinsho akinsho requested review from bryphe and CrossR October 4, 2018 21:05
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.

Looks good!

@akinsho akinsho merged commit 27cef2a into onivim:master Oct 19, 2018
@akinsho akinsho deleted the feature/remeasure-window-in-commandline branch October 19, 2018 09:24
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.

2 participants