Menu

Two questions/issues

globe199
2009-04-06
2012-11-13
  • globe199

    globe199 - 2009-04-06

    Two quick questions regarding Notepad++.  I apologize if these have been asked before.

    First, is there a way to disable the folder margin style?  I don't use it.  I changed it to 'simple' but it's still cluttering the screen.  I just want to turn it off.

    Second is a code color issue.  For example, when I'm coding in php, any CSS between <style> and </style> is not colored as CSS, but instead as "Default" php -- it's all just solid black bold text.  Not very useful.  On quick and dirty projects, I'll often put CSS in the php file to make things easier to develop.

    Any help is appreciated.  Thank you.

     
    • cchris

      cchris - 2009-04-11

      > I don't get why the Folder Margin
      > Style can't just be turned off.

      Probably because Scintilla considers folding as a central feature. However, it would be probably good that N++ doesn't reset the margin when the active tab changes. If it doesn't and Scintilla does it instead, then it is probably not feasible.

      Now on to the second point. There is a Language menu which enables you to choose which highlighting to use on the fly.

      When viewing say a CSS section in your PHP file, what happened is that the file was associated with the PHP lexer on load. Using the menu, you can change that to CSS, Javascript or whatever, and then revert. The language you last used for a file is remembered in the session file it is open ino.

      CChris

       
    • cchris

      cchris - 2009-04-07

      The closest thing I could find regarding your first request is this: in the Macros section of Shortcuts.xml, add

              <Macro name="test" Ctrl="yes" Alt="yes" Shift="no" Key="45">
                  <Action type="0" message="2242" wParam="2" lParam="0" sParam="" />
              </Macro>

      Here:
      * 45 is the code for the INS key; you can change it at will using Shortcut manager
      * 2242 is the # of the Scintilla message that sets the width of a margin
      * 2 is the number of the fold margin (numbering starts at 0)
      * 0 is the new width of the selected margin

      Note that this setting is reset whenever the active document changes, so you have to run the macro on every tab change.

      About the second point, the easiest thing is probably to change the highlighting language for the edited file: PHP to view the PHP part, CSS when viewing the CSS part etc. Otherwise, create an external lexer...

      CChris

       
    • globe199

      globe199 - 2009-04-10

      Thanks for the reply, though I'm not sure either of those things really help me.  I don't get why the Folder Margin Style can't just be turned off.  I'm not sure I understand what you're saying for the second point.

      Anyway, I've discovered a couple other things; they're related to the FTP plugin.

      Some strange things can happen with FTP.  If you've disconnected from the server (intentionally or otherwise), you can still "save" files.  You hit Ctrl+S and N++ acts like it saved the file, but obviously it doesn't, since you aren't connected.

      What should happen here is that it should automatically reconnect and save the file.  That's frustrating.  At the very least there should be an error, something like "Not connected to any server."

      The other thing is this...if you're connected to Site A but you've got a file from Site B still open and you save that file, basically the above behaviour will happen.  This is even more misleading.

      Futhermore, the FTP file browser dialog is very buggy.  Sometimes it will not see subfolders when trying to open a file or save a new file.