commit | de723fb887100a0da85673ba9fcd7b02ae1364e3 | [log] [tgz] |
---|---|---|
author | Paladox none <thomasmulhall410@yahoo.com> | Mon Aug 02 00:31:59 2021 +0000 |
committer | Paladox none <thomasmulhall410@yahoo.com> | Tue Aug 03 23:29:31 2021 +0000 |
tree | e90e26ca0fdf6ff1c962a5fe4aa1fcd07783b6ce | |
parent | e0a67217ae5359797570481cbb6e8aa1f5e0a7c3 [diff] |
Improve performance in the editor We stop setting viewportMargin and instead use the default value. We also add support for the inbuilt search support within codemirror. This is because with the removal of viewportMargin you cannot use the browsers search to search for the code. In my view i think this is a good trade off as you'll still be able to search using the codemirror searching support whilst improving performance for large documents. In GWTUI we didn't set viewportMargin. Bug: Issue 14845 Change-Id: I84f12168c4784cf40ca102f025b7805b44bc9d9a
A plugin that uses CodeMirror to provide a rich code editing experience in PolyGerrit.
This plugin is rewritten into Polymer 3 syntax. The gr-editor.js
is the main entry for the plugin.
But to support the lazy load on the codemirror
with supported languages, we still have the codemirror-element.html
as an asset which still built separately as an html.
We may consider drop the selectively language support and in favor of all-in-one bundle in the future or change build rule to support bundle css
in js
to move off of the html completely.
To run UI tests here will need install dependencies from both npm and bower.
npm run wct-test
should take care both for you, read more in package.json
.
You will need polymer-bridges
which is a submodule you can clone from: https://gerrit-review.googlesource.com/admin/repos/polymer-bridges
As polymer 3 no longer support Polymer.importHref
anymore, this plugin still supports it through a custom implementation in gr-editor.js
.
bazel build :codemirror_editor
gerrit/plugins/codemirror-editor/
folder and it will automatically served at http://localhost:8081/plugins_/codemirror-editor/
If your plugin is already enabled, then you can block it and then inject the compiled local verison.
See more about how to use dev helper extension to help you test here: https://gerrit.googlesource.com/gerrit-fe-dev-helper/+/master