SublimeText / InsertNums

Sublime Text plugin for inserting sequences. Supporting alphanumerics and hex, with bitwise operations!
https://james-brooks.uk
MIT License
123 stars 15 forks source link

Stops #8

Closed jbrooksuk closed 10 years ago

jbrooksuk commented 10 years ago

Sometimes you need to generate a list of numbers from 1-n where n could be a thousand or whatever. Obviously you don't want to generate a thousand new lines, select the regions and then use InsertNums.

This feature would automatically generate from current to a new stop variable. I'm not really sure how to generate lines without already having a region, so perhaps @FichteFoll could shed some light?

I guess we'd need to create a new region?

FichteFoll commented 10 years ago

Just don't replace regions and instead join the numbers with "\n" (which you then insert) is what I'd say.

jbrooksuk commented 10 years ago

That's so obvious!

The problem I'm having is that when using automatic mode — say you're trying to generate 1...100 — as you type 1, 0 and 0 in order, you'll end up with more numbers than anticipated, because it's running the on_change event.

FichteFoll commented 10 years ago

Sorry, I don't see the problem. In order to leave a clan undo history you have to undo every change made by InsertNums either way.

jbrooksuk commented 10 years ago

Pull down the stop-number branch and have a look. Try both preview and manual modes.

FichteFoll commented 10 years ago

Added in 2.0.0. (a22af2baa52abe850a3d278deeca184e7b244b29)