Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Clémence Roumy committed Apr 1, 2021
1 parent b03ce32 commit 7fa9489
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/format_markdown.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class FormatMarkdown {
static ResultMarkdown convertToMarkdown(MarkdownType type, String data, int fromIndex, int toIndex,
{int titleSize = 1}) {
late String changedData;
int? replaceCursorIndex;
late int replaceCursorIndex;

switch (type) {
case MarkdownType.bold:
Expand Down Expand Up @@ -52,7 +52,7 @@ class ResultMarkdown {
int cursorIndex;

/// index at which cursor need to be replaced if no text selected
int? replaceCursorIndex;
int replaceCursorIndex;

/// Return [ResultMarkdown]
ResultMarkdown(this.data, this.cursorIndex, this.replaceCursorIndex);
Expand Down
2 changes: 1 addition & 1 deletion lib/markdown_text_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class _MarkdownTextInputState extends State<MarkdownTextInput> {
.copyWith(text: result.data, selection: TextSelection.collapsed(offset: basePosition + result.cursorIndex));

if (noTextSelected) {
_controller.selection = TextSelection.collapsed(offset: _controller.selection.end - result.replaceCursorIndex!);
_controller.selection = TextSelection.collapsed(offset: _controller.selection.end - result.replaceCursorIndex);
}
}

Expand Down

0 comments on commit 7fa9489

Please sign in to comment.