Designing An Editor

This is a discussion on Designing An Editor within the C Programming forums, part of the General Programming Boards category; Can anyone tell me where to find info in designing a text editor?? More specific: i want to know what's ...

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    11

    Question Designing An Editor

    Can anyone tell me where to find info in designing a text editor??

    More specific:
    i want to know what's the best way to organize the data (chars)...what data structure to use...

    and which functions will help me navigate in the text.

    Thanks.

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Perhaps a linked list of linked lists. 1 entry in the "base list" for each "line", one node in each line list for each word.

    While this sounds like an OK way to do it, you may want just a single linked list. This would be the easiest, in that you could automaticly handle line-wrap by simply displaying each "word" and once your "current_line_length + next_word_length > max_line_length", then just put that on a new line.

    You then can easily create search functions, also you can track the current word you're at, and even the current letter in said word.

    Quzah.

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,761
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    Registered User pinko_liberal's Avatar
    Join Date
    Oct 2001
    Posts
    284
    You can get the source code vim and study how they have done it
    http://www.vim.org/download.html

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WYSIWYG editor problem
    By Akkernight in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 04-01-2009, 09:50 AM
  2. Replies: 19
    Last Post: 05-30-2007, 06:47 PM
  3. Replies: 12
    Last Post: 08-05-2003, 03:16 PM
  4. OpenGL terrain demo (EDITOR)
    By Jeremy G in forum Game Programming
    Replies: 2
    Last Post: 03-30-2003, 08:11 PM
  5. PFE (prorgammers file editor, for Windows)
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 06-09-2002, 12:01 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21