Skip to content

How to update CodeMirror

Daniel Di Sarli edited this page Sep 5, 2019 · 7 revisions

Merge Upstream Changes

Let's assume that Notepadqq is currently using CodeMirror 4.7.0 and you want to upgrade it to CodeMirror 4.8.0. From within our CodeMirror fork:

git remote add upstream https://github.com/codemirror/CodeMirror.git # First time only
git checkout 4.7.0-nqq
git pull origin 4.7.0-nqq
git checkout master
git pull origin master
git pull upstream master
git fetch upstream --tags
git checkout 4.8.0
git checkout -b 4.8.0-nqq
git merge 4.7.0-nqq

# Build and add artifact
npm install
npm build  # to create lib/codemirror.js
git add lib/codemirror.js && git commit

# Update remote
git push --all
git push --tags

Then, remember to update the subtree in Notepadqq to point to the new 4.8.0-nqq branch.

Add any new Language to Nqq

You can run the following command to get an idea of what modes were introduced between the two versions:

git diff 4.7.0-nqq 4.8.0-nqq -- mode/meta.js

Then, follow the instructions on how to add a new mode: https://github.com/notepadqq/notepadqq/wiki/How-to-let-Notepadqq-see-a-new-CodeMirror-language-%28mode%29