Skip to content

Commit

Permalink
Add setSizeInCssUnits method (#165)
Browse files Browse the repository at this point in the history
* add SetSizeInCssUnits

* dart format
  • Loading branch information
robbecker-wf authored May 8, 2023
1 parent 875ea42 commit 69aa33f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Changelog
## 0.7.11+5.65.13
- add setSizeInCssUnits(String?, String?) to the editor

## 0.7.10+5.65.13
- Update to CodeMirror 5.65.13
Expand Down
11 changes: 9 additions & 2 deletions lib/codemirror.dart
Original file line number Diff line number Diff line change
Expand Up @@ -495,11 +495,18 @@ class CodeMirror extends ProxyHolder {
String? getTokenTypeAt(Position pos) => callArg('getTokenTypeAt', pos);

/// Programmatically set the size of the editor (overriding the applicable CSS
/// rules). [width] and [height] can be either numbers (interpreted as pixels)
/// or CSS units ("100%", for example). You can pass `null` for either of them
/// rules). [width] and [height] are numbers (interpreted as pixels).
/// You can pass `null` for either of them
/// to indicate that that dimension should not be changed.
void setSize(num? width, num? height) => callArgs('setSize', [width, height]);

/// Programmatically set the size of the editor (overriding the applicable CSS
/// rules). [width] and [height] should be CSS units ("100%", for example).
/// You can pass `null` for either of them
/// to indicate that that dimension should not be changed.
void setSizeInCssUnits(String? width, String? height) =>
callArgs('setSize', [width, height]);

/// Scroll the editor to a given (pixel) position. Both arguments may be left
/// as null or undefined to have no effect.
void scrollTo(num? x, num? y) => callArgs('scrollTo', [x, y]);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# license that can be found in the LICENSE file.

name: codemirror
version: 0.7.10+5.65.13
version: 0.7.11+5.65.13
description: A Dart wrapper around the CodeMirror text editor.
repository: https://github.com/google/codemirror.dart

Expand Down

0 comments on commit 69aa33f

Please sign in to comment.