Commit Graph

946 Commits

Author SHA1 Message Date
Marijn Haverbeke 370f7c4a72 [lint addon] Make sure tooltips don't stick out of the window width
Issue https://github.com/codemirror/codemirror5/pull/7044
2023-07-21 21:23:28 +02:00
Marijn Haverbeke 1e58b28781 [lint addon] Remove confused annotation filtering 2023-06-29 17:15:39 +02:00
sahil.mahna f006b571d2 Add keyboard spacebar interactive for merge editor buttons 2022-12-14 09:12:26 +01:00
Marijn Haverbeke fbe612a66a [sql-hint addon] Fix getting keywords from plain sql mode 2022-12-08 08:35:48 +01:00
Marijn Haverbeke 7814ddf401 [sql-hint addon] Reindent 2022-12-08 08:35:48 +01:00
Marijn Haverbeke 742627abca [sql-hint addon] Fix retrieving of parser config 2022-11-15 09:36:27 +01:00
Marijn Haverbeke 407d1f1c89 [sql-hint addon] Make completion work when SQL isn't the outermost mode
Closes https://github.com/codemirror/codemirror5/issues/5249
2022-11-15 01:33:47 +01:00
Marijn Haverbeke ccacc38263 [show-hint addon] Resize popup if it doesn't fit in the viewport
Issue https://github.com/codemirror/codemirror5/pull/6979
2022-08-26 18:17:39 +02:00
Marijn Haverbeke 9232cb3750 [merge addon] Fix IE10 compatibility
By changing a function declaration to a variable declaration

Closes https://github.com/codemirror/codemirror5/issues/6976
2022-08-11 10:12:34 +02:00
Marijn Haverbeke 7ac872b0db [foldgutter addon] Recompute fold markers on mode change
Closes https://github.com/codemirror/codemirror5/issues/6968
2022-07-28 10:27:42 +02:00
Bjarki Ágúst Guðmundsson 4ccf2bddfe
[runmode addon] Use textContent instead of innerHTML to clear elements
In general, assigning a plain string to the innerHTML property of an
element can cause XSS vulnerabilities, and is thus considered as a
violation by the Trusted Types web platform security mechanism. This
commit addresses two such violations in CodeMirror by replacing them
with semantically equivalent assignments to the textContent property.
This is currently a blocker for CodeMirror users that want to enforce
Trusted Types in their web application.
2022-07-09 12:54:38 +02:00
Bjarki Ágúst Guðmundsson a6fdd560c7
[tern addon] Make sure dialog text is HTML escaped
This addresses a potential XSS vulnerability caused by tern's
construction of inline HTML where text input is not escaped, which is
then passed to the openDialog function for rendering. The construction
is replaced with an equivalent DOM fragment construction, which
the openDialog API also supports.

This is currently a blocker for CodeMirror users that want to enforce
Trusted Types in their web application.
2022-07-09 12:53:36 +02:00
Marijn Haverbeke 7f488eb5c1 Adjust website and github links to include '5' 2022-06-08 09:58:57 +02:00
benjaminr-ps e6f456f450
[show-hint addon] Make sure the tooltip is placed to the left of the viewport
We have to prevent to render the hint tooltip popup to far to the left, which exceeds the viewport.

If it exceeds the viewport too much to the left, we fallback to zero position.
2022-05-31 12:14:06 +02:00
Marijn Haverbeke 17897eaa5e Fix code style for #6920 2022-05-28 12:00:09 +02:00
Konrad Zapotoczny e024ab43a0
[search addon] Add a proper label to the search field
And improve contrast on dialog text.

Issue https://github.com/codemirror/CodeMirror/pull/6920
2022-05-28 11:57:47 +02:00
Luke Haas 52b26e84c3
[comment addon] Make sure whitespace on empty lines is preserved 2022-05-26 16:15:42 +02:00
sach.gupta 08ec7c24ac [merge addon] Add aria-label for merge editor buttons and make them tabbable & keyboard interactive 2022-04-07 16:04:24 +02:00
Geist-zz 17634c2205 [addon/edit/continuelist] Check mode.name AND helperType for "markdown" 2022-02-14 09:25:53 +01:00
Marijn Haverbeke 04323d0cc1 [brace-fold addon] Add a brace-paren folding helper
Closes https://github.com/codemirror/CodeMirror/issues/6868
2022-01-18 12:41:03 +01:00
Marijn Haverbeke aaba815f0c [brace-fold addon] Fix confusion when there are both braces and brackets on a line
Closes https://github.com/codemirror/CodeMirror/issues/6847
2021-12-13 11:54:15 +01:00
nightwing 5f8d6c4543 [vim] remove hack for handling $ in substitute pattern 2021-10-08 08:49:46 +02:00
Sachin Gupta d3f33a2a00
[merge addon] Allow merge editor buttons to be used with keyboard
Co-authored-by: sach.gupta <sach.gupta@servicenow.com>
2021-08-17 17:50:11 +02:00
Marijn Haverbeke 5180d1e0ed [lint addon] Fix a regression that broke the getAnnotations option
Introduced in 70c615c5ff
2021-07-21 13:41:46 +02:00
Marijn Haverbeke 3362178374 [search addon] Further simplify dialog building, fix bug in replace dialog
Issue #6746
2021-07-20 20:13:32 +02:00
Jakub Vrána 68d3399294 [search addon] Make compatible with Trusted Types
https://web.dev/trusted-types/ doesn't allow string innerHTML assignments. This change avoids it by using DOM instead.
2021-07-20 19:55:32 +02:00
Billiam f6934dae78
Improve folding addon performance
* Exit method early of mode is 'fold' instead of iterating

* Don't scanUp when iterating over every line of document

* Don't scanUp for forced unfolds (has no effect)
2021-07-20 14:13:50 +02:00
Marijn Haverbeke 579e120843 [show-hint addon] Set ARIA-related attributes for better screen reader support 2021-07-05 14:26:24 +02:00
Marijn Haverbeke 70c615c5ff [lint addon] Make sure options meant for the lint addon aren't passed to the inner linter
Since JSHint apparently complains about such unknown options.

Closes #6724
Closes #6729
2021-06-30 12:46:11 +02:00
Marijn Haverbeke b69f9d9bd5 [lint addon] And an arrow function 2021-06-14 09:29:17 +02:00
Marijn Haverbeke e23009989b [lint addon] Fix use of let 2021-06-14 09:25:49 +02:00
Marijn Haverbeke 7058f96865 [lint addon] Simplify and optimize removal of line classes
Issue #6708
2021-06-14 09:20:41 +02:00
lexer2086 3f098300d0
[lint addon] Highlight lines with warnings differently 2021-06-14 09:16:12 +02:00
Marijn Haverbeke d31bec5da9 [lint addon] Tweaks to highlightLines option
Issue #6704
2021-06-09 07:59:11 +02:00
lexer2086 b6bc7bdd47
[lint addon] Support highlighting lines with errors
Co-authored-by: anton.perov <anton.perov@tinypass.com>
2021-06-09 07:53:51 +02:00
Dimitri Mitropoulos f15619c492
[lint] Exit early if lint state is not present 2021-05-20 17:18:05 +02:00
Marijn Haverbeke dc3952a60b [simple-mode addon] Don't drop regexp unicode flags
See https://discuss.codemirror.net/t/some-of-my-simple-mode-unicode-patterns-dont-work-why/3101
2021-04-20 10:24:13 +02:00
Marijn Haverbeke 86af2dc6e2 [show-hint addon] Fix race condition in scroll measurement
Issue #6656
Issue #6467
2021-04-14 17:22:18 +02:00
mtaran-google 7e2466f165 [runmode] Pass the mode object to the callback
Without the mode object, it's not possible to call the mode's `indent` method to compute how much a given line should be indented (which we now have a need to do in a standalone way).
2021-04-07 10:06:10 +02:00
Nikolaj Kappler ee150b80a4
[tern addon] Move tooltips that would be off screen 2021-03-26 11:37:08 +01:00
Marijn Haverbeke f0154057fe [multiplex addon] Fix handling of sub-modes with parseDelimiters and identical delimiters
Closes #5369
Closes #5368
2021-03-18 12:36:44 +01:00
Marijn Haverbeke 769daa520d [mode/simple addon] Fix null dereference error on empty sub-matches
Closes #6618
2021-03-09 14:42:12 +01:00
Marijn Haverbeke 5fbd5384c4 [show-hint addon] Add check around removeChild call
Closes #6174
2021-02-25 21:43:41 +01:00
Marijn Haverbeke b29c728413 [matchbrackets addon] Treat and null tokes as interchangeable
Closes #6572
2021-01-19 18:15:59 +01:00
Thiemo Kreuz 4823ade863
[matchbrackets addon] Add highlightNonMatching option
It's not uncommon to have non-matching brackets in MediaWiki
wikitext source code. This is not always an error. Another
reason why we want to disable this feature is that it's rather
distracting while typing. We temporarily patched our copy of
the addon, but think it's worth having a proper config flag.

https://gerrit.wikimedia.org/r/656119
2021-01-14 12:49:27 +01:00
Marijn Haverbeke 6aa4fefafa [brace-fold addon] Pick first opening token on a given line
Closes #6560
2021-01-12 09:55:29 +01:00
Marijn Haverbeke 760f416c17 [closebrackets] Fix regression in exploding brackets
Closes #6558
2021-01-09 13:36:56 +01:00
Josh Soref 498e7c0c0a
Fix various spelling mistakes
* spelling: across

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: advise

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: aframework

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: after

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: alphanumeric

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: anyway

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: async

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: available

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: backticks

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: behavior

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: bracket

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: cacheable

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: characters

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: completeable

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: data

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: definition

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: different

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: do not

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: duplicate

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: e.g.

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: entities

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: expression-in

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: extract

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: feedback

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: filesystem

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: function

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: github

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: height

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: highlighted

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: i'm

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: identifier

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: immediately

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: in case

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: indentation

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: independent

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: initial

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: interchangeable

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: interruptible

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: interviews

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: intrinsic

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: javascript

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: label

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: matching

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: misbehavior

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: number

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: numbered

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: occurrences

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: repeatedly

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: separator

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: string

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: styleable

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: textarea

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: texture

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: useful

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: whenever

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: wikipedia

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2021-01-08 14:32:22 +01:00
Sebastian Ślepowroński a46e33049d
[show-hint addon] Changed closeOnCursorActivity to updateOnCursorActivity 2021-01-04 13:28:25 +01:00
Marijn Haverbeke d8d78f5e7a [panel addon] Preserve scroll post when initializing/removing panel wrapper
Closes #6533
2020-12-23 08:29:46 +01:00