Skip to content

Commit e5888d4

Browse files
committed
refactor: rename carretOffset to cursorOffset
1 parent df795a6 commit e5888d4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/smartQuotes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const hasSingleOpeningQuote = (textArr, offset, singleOpeningQuote) => {
3636
return false
3737
}
3838

39-
export const applySmartQuotes = (range, config, char, target, carretOffset) => {
39+
export const applySmartQuotes = (range, config, char, target, cursorOffset) => {
4040
const isCharSingleQuote = isSingleQuote(char)
4141
const isCharDoubleQuote = isDoubleQuote(char)
4242

@@ -74,6 +74,6 @@ export const applySmartQuotes = (range, config, char, target, carretOffset) => {
7474
// Resets the cursor to the currentPosition after applying the smart-quote
7575
const window = target.ownerDocument.defaultView
7676
const selection = window.getSelection()
77-
selection.collapse(newTextNode, carretOffset ?? offset)
77+
selection.collapse(newTextNode, cursorOffset ?? offset)
7878
}
7979

0 commit comments

Comments
 (0)