CodeEditor icon indicating copy to clipboard operation
CodeEditor copied to clipboard

autoscroll not working

Open naquin opened this issue 3 years ago • 2 comments

Not having any luck setting a selection and then it scrolling to that position per the example.

naquin avatar Sep 29 '22 00:09 naquin

Can you attach an example project? Is this on iOS or macOS?

helje5 avatar May 01 '23 15:05 helje5

Same issue ... here is my code:

let ce = CodeEditor(source : $activeItemModel.item.body, selection : $selection, language : language, theme : model.selectedTheme, flags : [ .selectable, .editable, .smartIndent ], autoPairs : [ "{": "}", "<": ">", "'": "'" ], autoscroll : true

` let startIndex = activeItemModel.item.body.index(activeItemModel.item.body.startIndex, offsetBy: searchIndices[lastIndice]) let endIndex = activeItemModel.item.body.index(activeItemModel.item.body.startIndex, offsetBy: searchIndices[lastIndice] + searchText.count)

selection = startIndex..<endIndex `

pkasson avatar Apr 07 '24 10:04 pkasson