onivim / oni

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

Feature/reapply syntax highlighting onColorscheme autocmd #2565

Closed akinsho closed 5 years ago

akinsho commented 6 years ago

This PR fixes the issue where setting your colorscheme e.g. as might happen when you source your vim config causes the syntax highlighting to be removed. The issue is/was that vim re-applied the vim colorscheme highlights ignoring oni's highlighting and oni having cached a record of the highlighted lines believes that everything is still highlighted.

This adds an action to the highlighter that is triggered on the colorscheme autocommand which causes oni to re apply its textmate based highlighting.

Outstanding

codecov[bot] commented 6 years ago

Codecov Report

Merging #2565 into master will decrease coverage by <.01%. The diff coverage is 59.15%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2565      +/-   ##
=========================================
- Coverage    45.3%   45.3%   -0.01%     
=========================================
  Files         361     361              
  Lines       14571   14589      +18     
  Branches     1912    1916       +4     
=========================================
+ Hits         6601    6609       +8     
- Misses       7746    7753       +7     
- Partials      224     227       +3
Impacted Files Coverage Δ
browser/src/Editor/BufferHighlights.ts 16.66% <ø> (ø) :arrow_up:
...es/SyntaxHighlighting/SyntaxHighlightingReducer.ts 30.95% <0%> (-4.19%) :arrow_down:
browser/src/Editor/NeovimEditor/NeovimEditor.tsx 8.62% <0%> (ø) :arrow_up:
browser/src/Utility.ts 46.32% <0%> (-0.7%) :arrow_down:
...ices/SyntaxHighlighting/SyntaxHighlightingStore.ts 25.86% <0%> (-0.46%) :arrow_down:
browser/src/neovim/NeovimInstance.ts 5.47% <0%> (ø) :arrow_up:
...ser/src/Services/SyntaxHighlighting/TokenScorer.ts 97.22% <100%> (ø) :arrow_up:
...Services/SyntaxHighlighting/TokenThemeProvider.tsx 90.62% <100%> (ø) :arrow_up:
.../Services/SyntaxHighlighting/SyntaxHighlighting.ts 22.91% <25%> (-1%) :arrow_down:
browser/src/Services/TokenColors.ts 59.57% <72.72%> (+2.43%) :arrow_up:
... and 2 more

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 11af1f8...c0c33f7. Read the comment docs.