GithubHelp home page GithubHelp logo

c-edit's Introduction

C-EDIT Project in C language (NO NCURSES)

C-EDIT for linux - IN PROGRESS - A linux text editor in the style of the MSDOS EDIT - WITHOUT USING NCURSES

  • WARNING: DO NOT EDIT YOUR PRECIOUS FILES WITH THIS EDITOR!!

Check TODO list to keep updated on the progress: 2024 -> Currently adding the Dynamic buffer (vector of lines) -> tests in https://github.com/velorek1/ceditbuf 2022 -> I have rewritten the screenbuffer and fixed polling issues (lynx: https://github.com/velorek1/lynx). Ideally, a keyboard library abstraction would be nice to expand the editor's possibilities.

TO INSTALL:

* Download or clone repository.
* Type "cd src", "make" and "./cedit" to execute.

So far I have implemented:

  • A very simple Double Screen Buffer with a simple linked list in memory for greater display control.
  • Rudimentary Text User Interface with Windows, Textbox, Keyboard handling, Color schemes, etc.
  • Automatic display resizing.
  • Open file dialog with a Listbox and SCROLL capabilities to navigate and find the file to open.
  • Rudimentary Edit buffer with vertical scroll.
  • A millisecond timer for animations.

Files in /src/:

  • rterm.c -> code for the library that handles output with Ansi Functions and kbhit() in linux console (with its header file)
  • list.c -> code for the circular linked list responsible for handling menus
  • scbuf.c -> code for controlling display with a double screen buffer (with its header file)
  • keyb.c -> module to control keyboard input.
  • opfile.c -> module that list files with scroll capabilities to select the file to open.
  • uintf.c -> module with user interface widgets: alert windows, confirmation windows, textbox, etc.
  • fileb.c -> module for single file operations.
  • tm.c -> module for a millisecond timer for animations (C11)
  • main.c -> Editor in C in the style of MSDOS EDIT (In progress).

As a screen buffer I have implemented a dynamic structure in memory that allows to save the current screen so that you can display new things on top and then go back to the previous (saved) screen. (simple linked list)

Alt text Alt text

c-edit's People

Contributors

mojadita avatar mysterywolf avatar velorek1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

c-edit's Issues

Backspace Key

I do not understand why the backspace key does not delete the characters as in any normal editor

Crashes on NetBSD and OpenBSD

Compiles well but when ran the main screen is partially displayed before crashing:

Screenshot

On OpenBSD it even disconnects the SSH session. Email me at [email protected] if you want to test for yourself, I can give you an account on my server.

OpenBSD 6.3 GENERIC#100 amd64
OpenBSD clang version 5.0.1 (tags/RELEASE_501/final) (based on LLVM 5.0.1)

NetBSD netbsd 8.0 NetBSD 8.0 (GENERIC) #0: Tue Jul 17 14:59:51 UTC 2018 [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC amd64
gcc (nb2 20180327) 5.5.0

Box drawing glitches on FreeBSD

The box drawing lines are missing and the colors are off when running on FreeBSD:

Screenshot

FreeBSD freebsd 11.2-RELEASE FreeBSD 11.2-RELEASE #0 r335510: Fri Jun 22 04:32:14 UTC 2018 [email protected]:/usr/obj/usr/src/sys/GENERIC amd64
FreeBSD clang version 6.0.0 (tags/RELEASE_600/final 326565) (based on LLVM 6.0.0)

Improve portability

Nice project!

I just tried to build C-edit under Serenity OS and got this far:

i686-pc-serenity-gcc    -c -o main.o main.c
i686-pc-serenity-gcc    -c -o rterm.o rterm.c
i686-pc-serenity-gcc    -c -o listc.o listc.c
i686-pc-serenity-gcc    -c -o scbuf.o scbuf.c
i686-pc-serenity-gcc    -c -o opfile.o opfile.c
i686-pc-serenity-gcc    -c -o uintf.o uintf.c
i686-pc-serenity-gcc    -c -o fileb.o fileb.c
i686-pc-serenity-gcc    -c -o keyb.o keyb.c
opfile.c: In function 'listFiles':
opfile.c:612:25: error: 'DT_DIR' undeclared (first use in this function); did you mean 'DIR'?
       if(dir->d_type == DT_DIR) {
                         ^~~~~~
                         DIR
opfile.c:612:25: note: each undeclared identifier is reported only once for each function it appears in
opfile.c:651:25: error: 'DT_REG' undeclared (first use in this function); did you mean 'F_RED'?
       if(dir->d_type == DT_REG) {
                         ^~~~~~
                         F_RED
<builtin>: recipe for target 'opfile.o' failed
make: *** [opfile.o] Error 1

Apparently you can use stat instead of d_type to make it more portable. Apparently d_type is a BSDism.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.