Author Topic: Bookmark text, when "Indent with tabs" is set  (Read 6118 times)

at5dapa1

  • Senior Community Member
  • Posts: 284
  • Hero Points: 24
Bookmark text, when "Indent with tabs" is set
« on: October 26, 2006, 08:48:38 AM »
Hi,
I don't have "Indent with tabs" checked, but I have old project files which have real TABs.
On that lines, the bookmark text is not shown in the "Text" column, but into a next 2nd column, which I have to scroll for it to make it visible (see attached "bad.jpg"), and which will dissapear on any resize.

I tried quick&dirty to correct this, by adding:
Code: [Select]
LineData = strip(LineData );after each
Code: [Select]
      _BookmarkGetInfo(bm_index,BookmarkName,
                       markid,vsbmflags,bufid,
                       0,RealLineNumber,col,BeginLineROffset,LineData,
                       Filename,DocumentName);
from bookmark.e.

For me the result is acceptable (see "better.jpg"). Maybe it helps somebody. I tested only in 11.0.2!
Daniel


ScottW, VP of Dev

  • Senior Community Member
  • Posts: 1471
  • Hero Points: 64
Re: Bookmark text, when "Indent with tabs" is set
« Reply #1 on: October 27, 2006, 03:16:04 PM »
Yup, good idea. I have filed a change request for this. It's small enough that it should be in v12. Does anyone see any reason not to strip the leading spaces from the Bookmark tool window?  Bueller?  Bueller?

--Scott

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Bookmark text, when "Indent with tabs" is set
« Reply #2 on: October 28, 2006, 08:21:56 PM »
I agree that it's a good idea.

Additionally I think a clipboard history toolbar very similar to this (bookmarks) would be fine.
And a 'View' popup window (mouse-over / timer based for current entry for keyboard-only users) displaying some context lines (-/+ N lines) of the bookmark or the (condensed) clipboard contents might be also a very useful.

What do you think ?

HS2
« Last Edit: October 28, 2006, 09:45:27 PM by hs2 »

Ding Zhaojie

  • Senior Community Member
  • Posts: 194
  • Hero Points: 37
Re: Bookmark text, when "Indent with tabs" is set
« Reply #3 on: October 29, 2006, 08:45:11 AM »
Yup, good idea. I have filed a change request for this. It's small enough that it should be in v12. Does anyone see any reason not to strip the leading spaces from the Bookmark tool window?  Bueller?  Bueller?

--Scott
Hi, can v12 add a "Todo list" just like the "Tasks" window in Eclipse JDT? I think it is a more common way to mark important things in codes than bookmarks.

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Bookmark text, when "Indent with tabs" is set
« Reply #4 on: October 30, 2006, 12:25:17 AM »
Good idea and a good complement to bookmarks, but IMO no real replacement for them.

@Ding:
I use this very simple, but useful (at least for me) workaround for the time being...

Code: [Select]
#include 'slick.sh'

// opt: c == current buffer, b == all buffers, p == project files, w == workspace files
_command int f2,find_2do (_str opt = 'c') name_info (','VSARG2_READ_ONLY|VSARG2_REQUIRES_EDITORCTL|VSARG2_MARK)
{
   int status = 0;
   _str search_options = make_search_options (VSSEARCHFLAG_WORD |
                                              VSSEARCHFLAG_RE |
                                              VSSEARCHFLAG_HIDDEN_TEXT |
                                              VSSEARCHFLAG_NOSAVE_TEXT |
                                              VSSEARCHFLAG_FINDHILIGHT |
                                              VSSEARCHFLAG_GO, true);
   search_options = search_options :+ '@W:PCCF';

   _str cur_word = '(TODO)|(FIXME)|(REMOVEME)|(DBG)|(HS2DO)|(DINGDO)';

   int grep_id = 9;   // -> Search<9>
   int mfff = MFFIND_THREADED | MFFIND_GLOBAL;

   clear_highlights ();
   switch ( opt )
   {
      case 'b':
         status=_mffind (cur_word, search_options, MFFIND_BUFFERS, "", mfff , false, false, '', '', true, grep_id);
         break;
      case 'p':
         status=_mffind (cur_word, search_options, MFFIND_PROJECT_FILES, "", mfff, true, false, '', '', true, grep_id);
         break;
      case 'w':
         status=_mffind (cur_word, search_options, MFFIND_WORKSPACE_FILES, "", mfff, false, true, '', '', true, grep_id);
         break;
      case 'c':
      default:
         status=_mffind (cur_word, search_options, MFFIND_BUFFER, "", mfff, false, false, '', '', true, grep_id);
   }

   cursor_data();
   return( status );
}

// (aliased) wrappers to be bound to keyboard shortcuts
_command int f2b,find_2do_buffers () name_info (','VSARG2_READ_ONLY|VSARG2_REQUIRES_EDITORCTL|VSARG2_MARK)
{
   return(find_2do ('b'));
}
_command int f2p,find_2do_project () name_info (','VSARG2_READ_ONLY|VSARG2_REQUIRES_EDITORCTL|VSARG2_MARK)
{
   return(find_2do ('p'));
}
_command int f2w,find_2do_wkspace () name_info (','VSARG2_READ_ONLY|VSARG2_REQUIRES_EDITORCTL|VSARG2_MARK)
{
   return(find_2do ('w'));
}

HS2

at5dapa1

  • Senior Community Member
  • Posts: 284
  • Hero Points: 24
Re: Bookmark text, when "Indent with tabs" is set
« Reply #5 on: October 30, 2006, 08:51:12 AM »
If you're going to update "Bookmarks", then it's not enough only to strip the string. You must also replace the tabs inside the string, with spaces. Else again we'll have something on the next column.