EASy68K  
It is currently Mon Sep 16, 2019 5:15 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Wed Feb 21, 2007 1:48 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1101
Add option to use spaces in place of tab characters in the editor. This would make it easier to format code for posting on the forum.

_________________
Prof. Kelly


Top
 Profile  
 
PostPosted: Wed Feb 21, 2007 7:58 pm 
Offline

Joined: Mon Dec 20, 2004 6:03 pm
Posts: 50
profkelly wrote:
Add option to use spaces in place of tab characters in the editor. This would make it easier to format code for posting on the forum.


This would be nice. The first thing I do in programming a environment is to set the "convert tabs to spaces" setting. Otherwise, it's a big pain when you load the code in a different editor.

This should be easy to implement...simply trap the tab key and insert X spaces.


Top
 Profile  
 
PostPosted: Fri Feb 23, 2007 2:03 am 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1101
ABeakyboy wrote:
This should be easy to implement...simply trap the tab key and insert X spaces.


Nothing that has anything to do with RichEdit controls is ever easy :(
Code:
  // if Tab key
  } else if(Key == VK_TAB) {
    Key = 0;    // null out the key code to prevent further processing
    CurPos = SourceText->CaretPos; //store position of cursor
    str1 = SourceText->Lines->Strings[CurPos.y];
    // replace tab with spaces
    int j=col, k, t;
    if (j < 255-8) {
      if (Project.TabType == Assembly) {
        if (j <= TAB1)
          t = TAB1 - j;
        else if (j <= TAB2)
          t = TAB2 - j;
        else
          t = TAB3 - j;
      } else {                      // else fixed tabs
        t = Project.TabSize - (j % Project.TabSize);
      }
      j++;
      for (k=0; k<t; k++) {       // replace with spaces
        str1.Insert(" ",CurPos.x+1);
        CurPos.x++;
      }
    }
    SourceText->Lines->Strings[CurPos.y] = str1;
    SourceText->CaretPos = CurPos;

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 23, 2007 2:15 am 
Offline

Joined: Mon Dec 20, 2004 6:03 pm
Posts: 50
like I said, piece of cake :D



*ABeakyboy runs away.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group