Q
Q
Questions00012020-08-26 21:07:37
Sublime Text
Questions0001, 2020-08-26 21:07:37

If in Sublime text I want to simultaneously insert certain code in 38 places of the source code at once, then how can I implement this?

the syntax code is the same. I do not want to go into the function every time and manually put the code. Who can help with this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Q
Questions0001, 2020-08-26
@Questions0001

I created my own code template and thus I will write something like this

A
Alexander Aksentiev, 2020-08-26
@Sanasol

There is such a rule that if the code is repeated 3 times, then it should be moved to a separate function (or whatever it is called in your particular language).
If you have 38 places with exactly the same piece of code, then you are clearly doing something wrong.
not to mention what you already know

I will continue to expand the program so

and that this code will still be repeated.
And for example, https://www.jetbrains.com/ recently had a feature for detecting duplicate code so that it is convenient to kill and search for it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question