elm-text-editor

A text editor written completely in Elm

  • 所有者: SidneyNemzer/elm-text-editor
  • 平台:
  • 許可證:
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

elm-text-editor

A flexible text editor written in Elm

Check out the demo

Note:

  • This project is not published yet on package.elm-lang.org
  • I would not consider this project ready for use in production, since it's missing major features like scrolling and line wrap

Features / Architecture

This library implements an editor (duh) and a buffer. The buffer is separate from the editor to allow multiple editors to use the same buffer, such as in a multi-panel text editor.

Note: There's a checkmark next to implemented features

Buffer

  • file content
  • save status
  • syntax highlighting (cached)
  • decorations (eg underlines, tooltips, gutter icons)

The buffer implementation has helper functions for manipulating its content, like finding the end of a word.

Editor

  • cursor location
  • selection
  • rendering to the DOM
  • UI interaction (mouse and keyboard)
  • undo history
  • scroll position
  • auto-complete dialog
  • open decorations (in other words, decorations exist in the buffer but each editor tracks open decorations)
  • line wrap

I hope that one day this project will be comparable to Ace and CodeMirror, but Ace and CodeMirror have had quite a head start (about 7 years!).

Previous work and Inspiration

The editor behavior and keyboard shortcuts are based on Atom (because that's the editor I'm most familiar with).

Ace and CodeMirror are text editors designed to work in a web browser. They're both written in JavaScript, so integration with Elm is pretty meh.

Janiczek recently demonstrated a text editor in pure elm, which implements work-arounds for several issues I had faced in the past when creating a pure elm editor.

I hope this inspires somebody to try some stuff in Elm they’ve been needing but seemed too big / hard for them! You might, like me with this project, find out it’s in your reach - no doubt thanks to Elm
- Janiczek

主要指標

概覽
名稱與所有者SidneyNemzer/elm-text-editor
主編程語言Elm
編程語言Elm (語言數: 1)
平台
許可證
所有者活动
創建於2018-06-08 23:22:49
推送於2020-01-31 12:07:00
最后一次提交2019-04-25 20:49:55
發布數0
用户参与
星數80
關注者數6
派生數14
提交數129
已啟用問題?
問題數3
打開的問題數3
拉請求數1
打開的拉請求數1
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?