Highlights include:
- New themes duotone-light and duotone-dark
- Various small fixes to language modes
Change-Id: I632cc2dd3815767293ea9638b0551f7a98f330b2
Instead, use a hard-coded map of licenses.
Hardcode a false dependency on diff-match-patch to avoid a diff for
the Apache2.0 license.
Tested:
bazel build Documentation:js_licenses.txt
buck build Documentation:js_licenses.txt
diff -u buck-out/gen/Documentation/js_licenses.txt/js_licenses.txt \
bazel-genfiles/Documentation/js_licenses.txt
diff shows only diffs for added [[header]] anchors.
Change-Id: I7886e1fadec900cf854a1b3b7c538b83d66af7a4
Output the actual jar path used for the build in the generated JS
file, rather than a broken Google Code link. This requires extracting
a constant for the version string.
Rename the addon_merge target to indicate that it includes bundled
dependency code from diff-match-patch, which fact is not otherwise
obvious.
Change-Id: I6512e5d65b81802d917f718f8e62ac414e8bffda
Reformat the Bazel build files with the buildifier tool [1].
The style is different for Bazel files. Most notably, indentation level
is 4 spaces instead of 2, and " is used instead of '.
[1] https://github.com/bazelbuild/buildifier
Change-Id: I95c0c6f11b6d76572797853b4ebb5cee5ebd3c98
Highlights include:
- javascript mode: Better indentation when semicolons are missing.
Better support for TypeScript classes, optional parameters, and the
type keyword.
Change-Id: I7a46c8dc058278ce484dacfa870050ed4c04f2eb
This is more or less straightforward migration of Buck codemirror
packaging rules: "jar" with non-minified JS version and "jar_r"
with minified JS version.
TEST PLAN:
bazel build //lib/codemirror:codemirror
bazel build //lib/codemirror:codemirror_r
Change-Id: I68a22902b5a24af9aa9479d27e6d160978631108
Highlights include:
- Make sure gutter backgrounds stick to the rest of the gutter during
horizontal scrolling.
- JavaScript mode: Fix some small parsing bugs and improve TypeScript
support.
- The "jade" mode has been renamed to "pug".
Change-Id: I5079f75490586aec851d5cf99860a91b1a5d590b
Highlights include:
- Fix problem with wrapped trailing whitespace displaying incorrectly.
- Prevent IME dialog from overlapping typed content in Chrome.
- Improve measuring of characters near a line wrap.
- javascript mode: Improve support for async, allow trailing commas in
import lists.
- vim bindings: Fix backspace in replace mode.
- sublime bindings: Fix some key bindings on OS X to match Sublime Text.
- markdown mode: Add more classes to image links in highlight-formatting
mode.
Change-Id: I206cc21c7a01940225b152134539af034c91237b
Interesting changes in the core library that might affect Gerrit
include:
- Fix issue where the editor would complain about overlapping
collapsed ranges when there weren't any.
- Optimize document tree building when loading or pasting huge chunks
of content.
No new language mode was added. Some improvements were done on several
existing language modes:
- markdown mode: Fix several issues in matching link targets.
- clike mode: Improve indentation of C++ template declarations.
- javascript mode: Support async / await and improve support for
TypeScript type syntax.
Change-Id: If40cb074527e7dcc73d1630c89baa5fe713b44bc
This adds a merge view to the inline editing screen so that users can
diff against the patch set the change edit is based on while editing.
This new functionality makes use of CodeMirror's merge view addon, which
requires Google's diff-match-patch library to be loaded. The library
implements an algorithm based on the Myers diff in JavaScript on the
client side, so there is no extra usage of Gerrit's DiffApi.
The minified diff-match-patch library is bundled with CodeMirror's merge
view addon during the build process.
By default, the merge view is disabled. This can be changed via
EditPreferencesBox. Also added a checkbox to the EditScreen header to
toggle the view.
The loading of the content of the base version is lazy - it is only
loaded when the merge view is actually used.
The documentation and tutorial on this new feature will be added in
later changes.
Screenshot: https://i.imgur.com/uNMNzjM.png
Change-Id: I5eb4af9b67bbfcb0b149965b3c818c1f6118e6de
This change makes all the CodeMirror themes as of the 5.14.2 release
available in DiffScreen and EditScreen.
Updated Documentation/rest-api-accounts.txt to reflect the addition.
Change-Id: Ic37e2ac5cfae91ed3cf61d7dc9d3345668715dae
Using CodeMirror's lint addon on the UI to display the blame
annotations. It works on both sides of the side-by-side
diff and also supports the auto-merge commit. It requires manual
step to enable the annotations to avoid any unnecessary git
processing and network traffic between the server and client.
Introduces a new dependency on blame-cache in gerrit-server
to reuse BlameCache.
In a following change, the gutter showing the blame info will be
made clickable. Clicking on the gutter will open a new tab that
takes the user to the corresponding change in Gerrit.
The commit SHA-1 hashes are currently not selectable. Making it
so might require an upstream change in CodeMirror's lint addon.
Bug: Issue 1642
Change-Id: I6267d30cbee448f8137e11c7120959dc424eaeeb
Sublime Text keymap has been available since CodeMirror 4.0. This change
enables using it in the EditScreen.
Change-Id: I34e82fceb9502405d8d03a6c6117d4900d08248e
This reverts commit 81b830df4e37d398ad957bb979b039f8e13a73ab.
Now that CodeMirror has been updated to 5.13.4, we are free to reapply
the original change.
Change-Id: I91edca137f52ca18c47b25fbc20cdf337189d9ef
The NPM WebJar is easier to deploy. As soon as the CodeMirror author
publishes a new version to NPM, anyone can deploy it to WebJars in one
click. In contrast, the classic WebJar requires a WebJars team member to
manually update and deploy it, which usually takes longer [1].
Also update version to 5.13.4, which was a trivial fix to include the
LICENSE file and brought no functionality change.
[1]: http://www.webjars.org/
Change-Id: I9328f371aa99cac7e81b3f8a442d6582275ad3a7
I36b4c29e2 introduced a typo in group id for non obfuscated CodeMirror
distribution.
Change-Id: If4f396d314fb7a6e689d3389676a5c73252a88b3
Reported-By: Marco Miller <marco.miller@ericsson.com>
Showing the diff for *.ini.erb files may fail with the following
CodeMirror error:
SEVERE: (TypeError) : a.multiplexingMode is not a function
Class$S155: (TypeError) : a.multiplexingMode is not a function
at Unknown.wrap_4(gerrit_ui-0.js)
at Unknown.entry0(gerrit_ui-0.js)
at Unknown.<anonymous>(gerrit_ui-0.js)
...
This is because the htmlembedded mode requires the CodeMirror
mode/multiplex addon [1]. Adding it fixes the issue.
[1] https://github.com/fixlr/codemirror-rails/issues/37
Change-Id: I5d33f0d073b9c9329dd4eaad1c4667d419777693
Signed-off-by: Edwin Kempin <ekempin@google.com>
I've started to maintain a minified CodeMirror distribution at
https://www.npmjs.com/package/codemirror-minified. It is released
on both NPM and WebJars with a version number that matches the
current version of CodeMirror. It comes with all non-test
JavaScript and CSS files minified.
Commit 7b11d6ad305f5106f3116146b4c442e81aa63b3f
(change I05d925c94a3c0368366e9d3ad109cf84492810fc) already turned off
CodeMirror obfuscation in non-release builds. With this further change,
we can avoid running Closure Compiler altogether.
Removed the special case for CodeMirror in
Documentation/gen_licenses.py since it's no longer needed.
Removed the now unused js_minify() rule and the rules for downloading
Closure Compiler and its externs. They will be re-added to tools/js for
minifying PolyGerrit.
Change-Id: I36b4c29e2300384f49d3660266cc7b89140c9faf
In I24790e84 I activated Closure Compiler tool chain to minify JS code.
In retrospective, it was wrong, of course, to unconditionally activate
the obfuscation, even in developer mode. As the consequence, devs have
hard time to troubleshoot Codemirror integration problems. Not to
mention, that the minifcation takes tons of time and not needed on dev
build. Also note, that every single language mode file is compiled.
In Ia9964735 I already disabled cast checking only in release mode. Use
the same differentiation and disable Codemirror obfuscation in non
release build.
Test Plan:
1. `buck build gerrit` should include non obfuscated Codemirror code
2. `buck build release` should include obfuscated Codemirror code
Change-Id: I05d925c94a3c0368366e9d3ad109cf84492810fc
This makes Closure Compiler add a "use strict;" directive to the
beginning of the output, which might improve the performance
on JavaScript engines.
Change-Id: I239d08bdbc47e98a373cf1b1d3b0417e36875dea
Closure Compiler now runs an additional flow sensitive variable
inlining pass before function inlining, which brings a small
improvement on code size.
Change-Id: I01a2f87c085b49091567467be107d211e769b085
We forgot to include these in the past CodeMirror upgrades.
Updated to include all language modes available as of 5.13.
Also add many more extensions to mime-types.properties so we get more
syntax highlighting.
Bug: Issue 3947
Change-Id: Ib5d45bce5b02d42d3b58423f97079d8d73318057
At least version 5.11 is needed to enable JSX mode, but we
couldn't use 5.11 or 5.12 due to a known issue with
bidirectional text [1]. Release 5.13 included Michael Zhou's
fix for [1].
Now that 5.13 is released and deployed to Maven, upgrade to that
version. JSX support, along with many more language modes that
we missed during previous upgrades, will be added in a follow-up
change.
[1] https://github.com/codemirror/CodeMirror/issues/3846
Change-Id: I37314d9d4f8aef98fe724a999c08f09aa7d411fa
This reverts commit 7c504473b0c16d4327f895b88240c3979c39ac7f.
We need to revert this CodeMirror upgrade because it broke displaying
the file diff for certain files as reported by issue 3927 [1].
[1] https://code.google.com/p/gerrit/issues/detail?id=3927
Bug: issue 3927
Change-Id: Id6ee70e3a8e9b5e5e31cde9bddc09106088ff31d
This reverts commit 99d8d3c21f2bcdcc15390964e893f0de5221ef18.
We need to revert the CodeMirror upgrade to 5.11 which was done by
Id02e65 because it broke displaying the file diff for certain files as
reported by issue 3927 [1]. Since this commit relies on the new
CodeMirror version is must be reverted as well.
[1] https://code.google.com/p/gerrit/issues/detail?id=3927
Change-Id: I6b15aa239666348e5c4ac50f4b248ef9a8f00cc5
The feature request to add native jump-to-line dialog to CodeMirror: [1]
was solved in context of this PR: [2]. So that now we can switch from
native and ugly Window#prompt() to nice looking CodeMirror addon.
Test Plan:
- Open change editor
- Type Alt-G|Ctrl-L|Cmd-L
- Jump to line dialog appears
- Type the line number: 42 and hit enter
- Confirm that the cursor is jumped to line 42
[1] https://github.com/codemirror/CodeMirror/issues/3030
[2] https://github.com/codemirror/CodeMirror/pull/3682
Change-Id: Ic9b889ea1efe26b3a19c5e885f1668009acc12ad
The closure-compiler jar now incudes its Java dependencies.
closure-compiler-externs no longer publishes a sources jar.
Change parse_graph() in Documentation/gen_licenses.py to always exclude
the edge from //lib/codemirror:js to //lib/codemirror:js_minifier.
Change-Id: I6a9160ffdb02347202a2b64c226f00c13cc0e19c
This version added new modes, improvements and bug fixes. One of
interesting new features is "Replace all" command that was added
to search addon and can now be used in inline editor. To invoke
this command from default mode:
replaceAll: Shift-Ctrl-R (PC), Shift-Cmd-Alt-F (Mac)
Change-Id: Ie7ed3d6139394424a9d682fdb1dba6003d490ef2