Commented Lines are not in order Topic is solved

Scripting and setups with Visual Studio Code (vscode) and AutoHotkey.
edc
Posts: 33
Joined: 17 Jun 2021, 16:23

Commented Lines are not in order

Post by edc » 22 Oct 2023, 15:23

Hello,
For some reason Microsoft Visual Studio is not keeping my comments for each line of code in order. When I open the file in Notepad all lines are correct. I have 100's of lines of code and need to have them in order.

Thanks,
EDC

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.




                coordmode, mouse, screen    		    ;coordmode, location on monitor
                mousegetpos, startX, startY 		    ;mousegetpos, location of mouse on screen
                send, {f7}				    ;sends f7
                sleep, 50				    ;sleeps
                mouseclick, left, 1987, 1214       	    ;L Click        
                sleep, 50				    ;sleeps 
                send, {f6}				    ;send f6 
                sleep, 50				    ;sleeps
                mouseclick, left, 1981, 1292		    ;mouse click x, y
                sleep, 20				    ;sleeps
                send, {f5}				    ;send f5
                mousemove, startX, startY		    ;mousemove to mousegetpos


Home::Reload                                    	    ;Reload Script
Return                                                      ;Return

Insert::Edit                                                ;Edit Script
Return                                                      ;Return

End::ExitApp                                                ;Exit Application
Return                                                      ;Return
Visual Studio Code.png
Visual Studio Code.png (80.43 KiB) Viewed 2923 times
Notepad Code.png
Notepad Code.png (48.11 KiB) Viewed 2923 times

ahk7
Posts: 591
Joined: 06 Nov 2013, 16:35

Re: Commented Lines are not in order  Topic is solved

Post by ahk7 » 22 Oct 2023, 15:29

That is because both editors have different "tab sizes" and you have mixed tab + spaces to align the comments. Check the tab size setting in notepad++ (settings, preferences, there should be tab size somewhere) - make it the same in vscode (probably 8 in notepad++ and 4 in vscode)

Or resort to spaces only for aligning the comments.

edc
Posts: 33
Joined: 17 Jun 2021, 16:23

Re: Commented Lines are not in order

Post by edc » 22 Oct 2023, 15:40

ahk7 wrote:
22 Oct 2023, 15:29
That is because both editors have different "tab sizes" and you have mixed tab + spaces to align the comments. Check the tab size setting in notepad++ (settings, preferences, there should be tab size somewhere) - make it the same in vscode (probably 8 in notepad++ and 4 in vscode)

Or resort to spaces only for aligning the comments.
That worked correctly! In Microsoft Visual Studio I was able to adjust the Tab Size from 4 to 8 and everything lined up.

File > Preferences > Settings > Typed In: Tab
Changed Tab Size from 4 to 8.

Thanks,
EDC

Post Reply

Return to “Visual Studio Code”