Author Topic: No syntax indent ruler in HTML or TXT or LUA files?  (Read 7420 times)

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
No syntax indent ruler in HTML or TXT or LUA files?
« on: June 25, 2008, 09:46:15 AM »
My HTML files are configured to use syntax indent, +4.
My ruler is configured to show syntax indent markings.
Just confirmed it works in C/C++ and Slick-C files -- but in HTML, Lua, and Txt files there are no markings on the ruler. ???
I suppose maybe the ruler type could be configurable on a per-language basis, but I wish that the syntax indent ruler could show normal tab stops when syntax indenting is not applicable (but in HTML and Lua syntax indenting does apply, according to the Options dialog, yet the ruler doesn't show markings).
Confused, or maybe just bleary-eyed...
C

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: No syntax indent ruler in HTML or TXT or LUA files?
« Reply #1 on: June 25, 2008, 11:21:49 AM »
Therefore I've added my impl. of the userSelectEditMode callback.
Note that it's the v12.0.3 version b/c I didn't migrate it to v13 yet.
I think it's compatible, but using the new 'language id' method is better.
Code: [Select]
int userSelectEditMode(_str origExt, boolean origBypassBufferSetup)
{
   _str ext = _bufname2ext ( p_buf_name );
   // messageNwait ("userSelectEditMode: ext: " ext " p_mode_name:" p_mode_name " p_SyntaxIndent:" p_SyntaxIndent " p_buf_name:" p_buf_name " stripped:" strip_filename( p_buf_name, 'PD' ));
   // VSCURRENT_LINE_BOXFOCUS_INDENT (my setup) fallback to VSCURRENT_LINE_BOXFOCUS_TABS
   // needed for buffers not supporting syntax indent (fundamental)
   int draw_box_option = p_SyntaxIndent ? VSCURRENT_LINE_BOXFOCUS_INDENT : VSCURRENT_LINE_BOXFOCUS_TABS;
   if ( draw_box_option != _default_option('u') ) {
      _default_option('u', draw_box_option);
   }
   return (1);
}

Strange that the syntax indent ruler isn't displayed for HTML/Lua...

HS2
« Last Edit: June 25, 2008, 11:24:02 AM by hs2 »

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: No syntax indent ruler in HTML or TXT or LUA files?
« Reply #2 on: June 25, 2008, 03:00:50 PM »
The tab stops are only displayed on the Syntax Indent ruler for fixed width fonts.  It's possible that your HTML and Lua source files are UTF-8, and the default Unicode Font is not fixed, so that would prevent the tab stops from being displayed.

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: No syntax indent ruler in HTML or TXT or LUA files?
« Reply #3 on: June 25, 2008, 07:16:20 PM »
My default Unicode font is Consolas which is fixed width (see screen shot).
I'll poke around a bit and try to track down what's going wrong.

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: No syntax indent ruler in HTML or TXT or LUA files?
« Reply #4 on: June 25, 2008, 07:57:23 PM »
Looks like there's another option that does need to be set in the Colors options.   In the Font Style group, Use fixed spacing for bold and italic fixed Unicode fonts needs to be set to True.  Try that.

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: No syntax indent ruler in HTML or TXT or LUA files?
« Reply #5 on: June 25, 2008, 09:26:45 PM »
Thanks, Lee, that did the trick (HP++, I wouldn't have figured that out on my own).
I was happy to find that the option is global (saving me from updating each color scheme individually).

(As an aside, I wonder why the option is off by default).

Gary

  • Community Member
  • Posts: 43
  • Hero Points: 5
Re: No syntax indent ruler in HTML or TXT or LUA files?
« Reply #6 on: May 13, 2011, 06:58:54 AM »
Just fell into the same trap with V16 - two .java files behaving differently which was really confusing.
@SlickEdit: I Would find it more intuitive if "Use fixed spacing for bold and italic fixed Unicode fonts" would be the default setting.