Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autoscroll not working #18

Open
naquin opened this issue Sep 29, 2022 · 2 comments
Open

autoscroll not working #18

naquin opened this issue Sep 29, 2022 · 2 comments
Labels
question Further information is requested

Comments

@naquin
Copy link

naquin commented Sep 29, 2022

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

@helje5
Copy link
Member

helje5 commented May 1, 2023

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

@helje5 helje5 added the question Further information is requested label May 1, 2023
@pkasson
Copy link

pkasson commented Apr 7, 2024

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
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants