This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
KingMachine's profile picture

"anti" tab

Started by KingMachine, 09 February 2013 - 05:41 AM
KingMachine #1
Posted 09 February 2013 - 06:41 AM
In MOST text editors, specifically compilers, there is the option to use SHIFT + TAB. It UNTABS the line rather than tabbing it. It would be greatly appreciated, and simple, to add this into the edit program.

I'm not really experienced enough to do it, but it would be something like if key shift is being pressed then if tab is being pressed do oppositeOfTab().

I'll be working on it though and if I get it done I'll post the source. (by the way, thank you for entire line tabs, I hate having to hit home first)
GopherAtl #2
Posted 09 February 2013 - 06:46 AM
not simple actually, as thre is no way to tell if shift is held down or not when tab is recieved. You could detect shift followed by tab, but this could easily "misfire."
Cranium #3
Posted 09 February 2013 - 06:48 AM
Just do this:
1. 'home'
2. 'delete'
3. 'delete'

not backspace, DELETE
This will delete the default two spaces that are added. No need to get all fancy.
Cruor #4
Posted 09 February 2013 - 07:27 AM
Do what cranium said, and its called decrease indent(ation), just incase you wondered :3
GravityScore #5
Posted 09 February 2013 - 04:46 PM
Just do this:
1. 'home'
2. 'delete'
3. 'delete'

not backspace, DELETE
This will delete the default two spaces that are added. No need to get all fancy.

Or if you're on a mac, instead of pressing delete (no such thing I think, at least on a laptop there isn't) hold function while pressing backspace.
Cranium #6
Posted 09 February 2013 - 04:50 PM
XP mac……yeah…… ew. </personal preference>
theoriginalbit #7
Posted 09 February 2013 - 06:13 PM
Or if you're on a mac, instead of pressing delete (no such thing I think, at least on a laptop there isn't) hold function while pressing backspace.
On Mac the 'backspace' key is called 'delete' so you press 'fn' + 'delete' to do the same as delete. OR if you have a full Apple Wired Keyboard it does have a 'delete' button in addition to the 'delete' ('backspace')

It's a bit like tab… LWJGL is programmed wrong and to do a tab in MC you need to press 'fn' + 'tab' to use tab… Damn LWJGL…
KingMachine #8
Posted 09 February 2013 - 07:04 PM
not simple actually, as thre is no way to tell if shift is held down or not when tab is recieved. You could detect shift followed by tab, but this could easily "misfire."
I'm well aware of this actually. coroutine seems to be my only option
GopherAtl #9
Posted 09 February 2013 - 08:00 PM
..what?
ElvishJerricco #10
Posted 09 February 2013 - 08:11 PM
Just do this:
1. 'home'
2. 'delete'
3. 'delete'

not backspace, DELETE
This will delete the default two spaces that are added. No need to get all fancy.

Or if you're on a mac, instead of pressing delete (no such thing I think, at least on a laptop there isn't) hold function while pressing backspace.

I did not know this keyboard shortcut… Many thanks.
Cloudy #11
Posted 10 February 2013 - 12:25 AM
Nice idea, not gonna happen until we have a reliable way to detect if a key is held down.