Thread: build a simple text editor

  1. #1
    Registered User blob84's Avatar
    Join Date
    Jun 2010
    Posts
    46

    build a simple text editor

    Hi, i have in mind to build a simpletext editor, not like vi for linux, but more like gedit, but command line not gui.
    For who knows the subjetc, what are the main problems to solve?

  2. #2
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,949
    When you say 'command line not gui' are you referring to making a full screen text editor like the old MS-DOS edit program or a command line editor like edlin?
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  3. #3
    Registered User \007's Avatar
    Join Date
    Dec 2010
    Posts
    179
    Check out the ncurses library.

  4. #4
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,334
    You can also search the forums for "making text editor" as we've had two or three moderately interesting threads on the topic here.

  5. #5
    Registered User blob84's Avatar
    Join Date
    Jun 2010
    Posts
    46
    Quote Originally Posted by AndrewHunter View Post
    When you say 'command line not gui' are you referring to making a full screen text editor like the old MS-DOS edit program or a command line editor like edlin?
    a full screen text editor without gui, it means it should work without desktop environment.

  6. #6
    Registered User
    Join Date
    Jul 2007
    Posts
    131
    IMO the main problem to solve is how to store the file contents internally, because everything else except some ui stuff is built over the internal data structure containing the file contents. Gap buffer is quite nice and (at least I've been told) used, some of more line oriented editors like vi use just some kind of linked list of which every node contains one line of text.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simple text editor help
    By Fink in forum C Programming
    Replies: 45
    Last Post: 01-18-2011, 02:12 PM
  2. creating very simple text editor using c
    By if13121 in forum C Programming
    Replies: 9
    Last Post: 10-19-2010, 05:26 PM
  3. developing a simple Text editor in C
    By rssrik in forum C Programming
    Replies: 10
    Last Post: 07-03-2007, 03:28 AM
  4. simple text editor in C
    By adil75950 in forum C Programming
    Replies: 2
    Last Post: 03-12-2002, 01:15 PM