simonsteele / pn

Programmer's Notepad
374 stars 115 forks source link

Comment keyboard shortcut wrongly uses ";" as single-line comment symbol for PowerShell files #97

Closed cheesecracker closed 9 years ago

cheesecracker commented 9 years ago

PN wrongly uses ";" as single-line comment symbol for PowerShell (.ps1) files.

Steps to reproduce problem:

  1. Open any ps1 file in PN
  2. Select several lines
  3. Use keyboard shortcut Ctrl+; (or menu Edit > Comment > Line)

Expected result: "#" characters are inserted at the beginning of each line

Actual result: ; characters are inserted at the beginning of each line

PS: Is this character configured somewhere so I can do a quick correction while waiting for the official bug fix?

simonsteele commented 9 years ago

This has been fixed for the next release, and yes you can fix it yourself, change powershell.scheme like this:

https://github.com/simonsteele/pn/blob/master/pnwtl/bin/schemes/powershell.scheme

cheesecracker commented 9 years ago

OK, after comparison, I found that it's defined in this line:

By that, I've seen another problem. In PowerShell 2.0 and later version, to declare multi-line comment block, the syntax is like this:

<# Eveything inside this block is comment in PowerShell 2.0 and above

>

So, I think streamStart and streamEnd have to be changed as well.

About "Block", there is no equivalent. But we can "cheat" :p Just put a space in blockLine, while blockStart and blockEnd are the same as streamStart and streamEnd.

PS: I know that you are very busy because of your family and you have less and less time to dedicate on this free software. I really really appreciate it and you can make a new release :)