Author Topic: notepad++ question for anyone who uses it  (Read 5718 times)

0 Members and 1 Guest are viewing this topic.

andrew_nao

  • Guest
notepad++ question for anyone who uses it
« on: June 20, 2013, 01:45:25 PM »
for anyone who uses notepad++ for coding, do you know of a way to have the commented text always be highlighted instead of being a set color?

right now any comment i leave in a file is green text, i would like to just have it highlighted
is this possible? im not seeing anyway but maybe someone else knows of a way

thanks

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: notepad++ question for anyone who uses it
« Reply #1 on: June 20, 2013, 02:08:59 PM »
I'm guessing it would be as easy as modifying the xml file to reflect the desired background color.

For example, yellow (FFFF00) as the highlight (background) color:

Code: [Select]
...
<WordsStyle name="COMMENT" styleID="1" fgColor="008040" bgColor="FFFF00" fontName="" fontStyle="0" />
<WordsStyle name="COMMENT LINE" styleID="2" fgColor="008040" bgColor="FFFF00" fontName="" fontStyle="0" />
...

<shrug>

Also see this post.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

andrew_nao

  • Guest
Re: notepad++ question for anyone who uses it
« Reply #2 on: June 20, 2013, 02:49:07 PM »
thanks

that didnt work though, i tried to import the your file you linked to and it screwed up my color coding completely LOL


i tried to uninstall and reinstall a newer version but my color codes still arent working
i did something to mess this up ... *sigh*


MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: notepad++ question for anyone who uses it
« Reply #3 on: June 20, 2013, 02:56:18 PM »
Sorry?

This is the first I've ever heard the file I provided screwed up someone's system.

If you can determine how my file is dekcuf up I'll fix it but I don't see anything wrong with it (acknowledging I don't use it myself as I use TextPad & UltraEdit or my ASCII bashing).
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: notepad++ question for anyone who uses it
« Reply #4 on: June 20, 2013, 03:09:07 PM »
do you know of a way to have the commented text always be highlighted instead of being a set color?

Assuming that you haven't defined your own language syntax file specifically for AutoLISP and that you are using the default LISP language defined in Notepad++ for opening .lsp files: go to Settings > Style Configurator; select LISP from the Language list and COMMENT from the Style list, then change the Background Color.

andrew_nao

  • Guest
Re: notepad++ question for anyone who uses it
« Reply #5 on: June 20, 2013, 04:15:38 PM »
Sorry?

This is the first I've ever heard the file I provided screwed up someone's system.

If you can determine how my file is dekcuf up I'll fix it but I don't see anything wrong with it (acknowledging I don't use it myself as I use TextPad & UltraEdit or my ASCII bashing).

i dont even know how it did either to even explain it. i followed the steps in your link that showed how to import it but all my text went to black and my color coding was gone
but i did get it back to normal i had to goto language> then L and click on the "lisp" flyout


@Lee, that didnt work either. i think what im asking isnt possible with this.
the commentline is what i was after to always be highlight not just a different color.

i just leave it as it.

thanks for the replies  :mrgreen:

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: notepad++ question for anyone who uses it
« Reply #6 on: June 20, 2013, 05:06:12 PM »
@Lee, that didnt work either. i think what im asking isnt possible with this.
the commentline is what i was after to always be highlight not just a different color.

Sorry, change the Background Colour of the COMMENTLINE Style, not the COMMENT Style.
Also, for 'Global Styles' in the Language list, ensure 'Enable global background colour' is disabled.

Result:

MeasureUp

  • Bull Frog
  • Posts: 462
Re: notepad++ question for anyone who uses it
« Reply #7 on: June 20, 2013, 08:16:37 PM »
Thanks and this is nice to learn.
What if I want to highlight the comments below? Is it possible?
Quote
;|
atof       = a-tov
atoi       = A-toy
itoa       = I-T-O-A
rtos       = R-toz
distof     = diss-tov
|;

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: notepad++ question for anyone who uses it
« Reply #8 on: June 21, 2013, 05:27:35 AM »
Thanks and this is nice to learn.
What if I want to highlight the comments below? Is it possible?
Unfortunately I've not seen that working in Notepad++. It doesn't have a decent multiline comment parsing, at least not for AutoLisp.

In normal (built-in) Lisp mode it works fine for the #| .... |# multi-line comments. But I can't find a place to change that to use ;| ... |; instead. The only way I can get these to work is through a custom language (like the one in that other thread), but then you find it needs a double character for line comments: ;; ... otherwise the multiline version is ignored.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

andrew_nao

  • Guest
Re: notepad++ question for anyone who uses it
« Reply #9 on: June 21, 2013, 10:05:23 AM »
@Lee, that didnt work either. i think what im asking isnt possible with this.
the commentline is what i was after to always be highlight not just a different color.

Sorry, change the Background Colour of the COMMENTLINE Style, not the COMMENT Style.
Also, for 'Global Styles' in the Language list, ensure 'Enable global background colour' is disabled.

Result:


thanks that worked.

MeasureUp

  • Bull Frog
  • Posts: 462
Re: notepad++ question for anyone who uses it
« Reply #10 on: June 23, 2013, 07:28:46 PM »
Thanks and this is nice to learn.
What if I want to highlight the comments below? Is it possible?
Unfortunately I've not seen that working in Notepad++. It doesn't have a decent multiline comment parsing, at least not for AutoLisp.

In normal (built-in) Lisp mode it works fine for the #| .... |# multi-line comments. But I can't find a place to change that to use ;| ... |; instead. The only way I can get these to work is through a custom language (like the one in that other thread), but then you find it needs a double character for line comments: ;; ... otherwise the multiline version is ignored.
Thanks irneb.

smemo

  • Mosquito
  • Posts: 19
Re: notepad++ question for anyone who uses it
« Reply #11 on: June 26, 2013, 03:00:44 AM »
on menu, "Language" -> "User Define Language", select Autolisp, Sheet "Comment & Number" on section "Commet Block"  button "Styler"

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: notepad++ question for anyone who uses it
« Reply #12 on: June 26, 2013, 04:11:37 AM »
on menu, "Language" -> "User Define Language", select Autolisp, Sheet "Comment & Number" on section "Commet Block"  button "Styler"
As I stated, yes it works. But then it doesn't work for single ; comments. If you then change the comment line to allow for single ; comment, then the multi-line comments don't work anymore.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: notepad++ question for anyone who uses it
« Reply #13 on: June 26, 2013, 04:20:51 AM »
The way where the built-in Lisp gets around this is by using the CL's multi-line comment style. But of course that one doesn't work with AutoLisp, as ACad does not read this as a comment mark.


It's a "bug" in Notepad++ (IMO). It uses the comment line's tag as override to everything else. It should have used the comment start/stop tag as override, then this issue wouldn't have been  an issue.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.