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

replace_all #453

Closed
zoli opened this issue Nov 25, 2014 · 4 comments
Closed

replace_all #453

zoli opened this issue Nov 25, 2014 · 4 comments
Labels

Comments

@zoli
Copy link
Member

zoli commented Nov 25, 2014

No description provided.

@ghost
Copy link

ghost commented May 3, 2015

Hey, I am trying to fix this issue as an icebreaker into this project and learning Go. The issue I am facing is with using nextSelection (in lib/commands/findreplace.go) as a means to replace all words. If I use it, I have to return err every time as I always reach a point where there will be no more words to replace. Is it a better idea to create a helper function to return all regions to replace, or is returning an err everytime acceptable?

@zoli
Copy link
Member Author

zoli commented May 4, 2015

As you should call the nextSelection function multiple times you can check if there was error in all calls or not. If a single call didn't return error you shouldn't return error.

@quarnster
Copy link
Member

Is it a better idea to create a helper function to return all regions to replace,

Such a function will be needed sometime for the "highlight matches" setting, so it isn't a bad idea to think about how to implement it.

@erbridge
Copy link
Contributor

Migrated to limetext/backend#2.

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

No branches or pull requests

3 participants