mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
typeahead: Replace substring with slice.
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-slice.md
This commit is contained in:
@@ -198,7 +198,7 @@ import {get_string_diff} from "../../src/util";
|
|||||||
this.$element.val(),
|
this.$element.val(),
|
||||||
after_text,
|
after_text,
|
||||||
);
|
);
|
||||||
const replacement = after_text.substring(from, to_after);
|
const replacement = after_text.slice(from, to_after);
|
||||||
// select / highlight the minimal text to be replaced
|
// select / highlight the minimal text to be replaced
|
||||||
this.$element[0].setSelectionRange(from, to_before);
|
this.$element[0].setSelectionRange(from, to_before);
|
||||||
insertTextIntoField(this.$element[0], replacement);
|
insertTextIntoField(this.$element[0], replacement);
|
||||||
|
|||||||
Reference in New Issue
Block a user