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

add hotkey for comment/uncomment #95

Closed
Gi972 opened this issue Apr 8, 2017 · 16 comments
Closed

add hotkey for comment/uncomment #95

Gi972 opened this issue Apr 8, 2017 · 16 comments
Assignees
Labels
enhancement Improvement of existing feature or adding something new
Milestone

Comments

@Gi972
Copy link

Gi972 commented Apr 8, 2017

Hello,

It's possible to add a hotkeys for comment / uncomment the code in the text editor when you highlight ?

@Crutiatix
Copy link

Crutiatix commented Apr 8, 2017

A question is how much complex code editor we want. I think, that one of the basic ideas of TIC-80 is a simplicity so adding shortcuts for any little gimmick goes against this idea. For writing a more extensive code is better to use a external editor in which you can use all kinds of plugins and exensions.

However, useful feature which is common in many code editors would by a possibility to close a selected text into a parenthesis ()[]{}""'' and in the case of lua also - respectively --. This could partially solve @Gi972 's request.

@hashalon
Copy link

hashalon commented Apr 8, 2017

I think plugins for Atom, VSCode, SublimText, Brackets, Notepad++ would be a really good idea.

@Gi972
Copy link
Author

Gi972 commented Apr 8, 2017

I'm alright with you,

In fact is more suggestions for improve experience when you write code and reflex pratices and increase productivity. Free of you to implement this or not :-)

@Harraps I prefer stay on the tic editor because I can run quickly when i debug :-)

@Gi972
Copy link
Author

Gi972 commented Apr 8, 2017

by the way @nesbox it's possible open the file with a external editor?

@Crutiatix
Copy link

Crutiatix commented Apr 8, 2017

@Gi972 It's not a problem to run fast a code from external editor in TIC.
Just if you add a path to tic.exe to PATH enviroment variable and then setup a build commands in editor like:
SublimeText: Tools > Build System > New Build System... and then input into new created file:
edited: fixed, tested, it works for me

{
"cmd": ["tic", "%APPDATA%/TIC-80/0.21.0 dev/${file_base_name}.tic", "-code","$file"],
"shell":true
}

Save as TIC, then switch to new build system: Tools > Build System >TIC and lastly press CTRL+B for build.
It's just example. I'm not sure if it works.
I'm using Atom and for this purpose the plugin build-tools.

@trelemar trelemar added the discussion Issues with no clear action or preferred solution label Apr 8, 2017
@Gi972
Copy link
Author

Gi972 commented Apr 8, 2017

Ok @Crutiatix I code with visual studio code, I will try with it, thanks for the tips ;-)

@Gi972
Copy link
Author

Gi972 commented Apr 8, 2017

@Crutiatix ,

Are you on mac or pc?

I try on sublime text 3 but when I save TIC build system it don't appear on the menu :-/
So I cant build.
And I cant open a file too...

@nesbox I see on #69 if possible launch a file from terminal, I try on mac tic game.tic but I have a error :
"tetris.tic", line 1, col 1: Illegal character (expected alphanumeric or @%&*!#) - '^A'

@nesbox
Copy link
Owner

nesbox commented Apr 9, 2017

@Gi972
Using external editors in TIC-80 - https://github.com/nesbox/tic.computer/wiki#using-external-code-editors

Could you pls provide exact info how to reproduce:

"tetris.tic", line 1, col 1: Illegal character (expected alphanumeric or @%&*!#) - '^A'

@Gi972
Copy link
Author

Gi972 commented Apr 9, 2017

When I open terminal on the repertory of game folder I write I :

MacBook-Pro-de-Gi:0.21.0 dev j3di$ tic tetris.tic 

"tetris.tic", line 1, col 1: Illegal character (expected alphanumeric or @%&*!#) - '^A'

I try too

MacBook-Pro-de-Gi:Applications j3di$ open "tic.app tetris.tic"

The file /Applications/tic.app tetris.tic does not exist.

or

MacBook-Pro-de-Gi:Applications j3di$ open "tic.app" --args tetris.tic

it's launch tic but don't load

maybe I don't use the good command, hum hum :-D

Could you give me steps to follow?...

@nesbox
Copy link
Owner

nesbox commented Apr 9, 2017

@Gi972

  • in the first case you are calling 'tic' from /usr/bin/tic and it's another's process, not TIC-80
  • in the second, you are trying to pass args to app package tic.app, TIC loads but without cart, here you have to pass full path to the cart $ open ./tic.app --args ~/Desktop/tic/tetris.tic to open local .app package or $ open -a tic --args ~/Desktop/tic/tetris.tic to open installed package
  • also you can call tic directly from inside .app package $ tic.app/Contents/MacOS/tic tetris.tic, in this case you can use relative paths to the cart

@Gi972
Copy link
Author

Gi972 commented Apr 9, 2017

@nesbox

Ok

I copy the code of tetris. ti c in tetris.lua

I try

 MacBook-Pro-de-Gi:Tic j3di$ /Applications/tic.app/Contents/MacOS/tic tetris.tic -code /Users/j3di/Desktop/Dev/Tic/tetris.lua

It's work, it launch tic et load the file.lua but dont load I think the cart I don't see sprites in sprite editor or in map :-/

I forgot something?

@nesbox
Copy link
Owner

nesbox commented Apr 9, 2017

@Gi972
Are you sure you've installed tic .21 to the Application folder, because -code argument was added in .21 ?

@Gi972
Copy link
Author

Gi972 commented Apr 9, 2017

Ok I try in put the file tetris.tic and tetris.lua in the same folder and it works.

I understand I forgot in my precedent post the path in the second argument of tetris.tic
The correct command is:

MacBook-Pro-de-Gi:Tic j3di$ /Applications/tic.app/Contents/MacOS/tic /Users/j3di/Library/Application\ Support/TIC-80/0.21.0\ dev/tetris.tic -code /Users/j3di/Desktop/Dev/Tic/tetris.lua

Hope that help other users
thanks for your patience and help

@Gi972
Copy link
Author

Gi972 commented Apr 9, 2017

So for the main subject do you think comment/uncomment it's a bad idea?

@nesbox
Copy link
Owner

nesbox commented Apr 10, 2017

@Gi972 it's a great idea :)
I'll add CTRL + / (CMD + / on Mac) to comment/uncomment line

@nesbox nesbox self-assigned this Apr 10, 2017
@nesbox nesbox added enhancement Improvement of existing feature or adding something new and removed discussion Issues with no clear action or preferred solution labels Apr 10, 2017
@nesbox nesbox added this to the 0.23.0 milestone May 2, 2017
@nesbox
Copy link
Owner

nesbox commented May 3, 2017

Added line comment/uncomment by CTRL + / (CMD + / on Mac)

comment

done on .23

@nesbox nesbox closed this as completed May 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement of existing feature or adding something new
Projects
None yet
Development

No branches or pull requests

5 participants