summaryrefslogtreecommitdiff
path: root/editor.c
AgeCommit message (Collapse)Author
2015-07-28text: move utility functions to separate fileMarc André Tanner
2015-07-26vis: add infrastructure to support multiple cursors/selectionsMarc André Tanner
This cleans up the existing selection handling code and adds the necessary bits to eventually support multiple cursors/selections. The cursor position is kept track of using marks, which means retrieving the cursor position is no longer a constant time operation. Furthermore the terminal cursor is no longer used, instead the whole window is redrawn after every cursor movement.
2015-07-21ui: further separate curses related user interface codeMarc André Tanner
By now ui-curses.[hc] are the only files dealing directly with curses related functions. Integration of a proper mainloop is still pending.
2015-07-19vis: handle file truncation more gracefullyMarc André Tanner
If we use the file / virtual memory system as cache (using mmap(2)) and another process truncates the file we are editing, we have a problem. All we can do is catch the resulting SIGBUS, close the corresponding window and print a warning message. To test this use: $ dd if=/dev/zero of=TEST bs=8M count=1 $ vis TEST :! echo TRUNCATE > TEST
2015-07-06Warn when saving a file which has been changed outside the editorMarc André Tanner
2015-07-06text: remove text_load_fd and text_fd_getMarc André Tanner
2015-07-06Move filename from Text to FileMarc André Tanner
Also apply syntax rules every time the file name changes.
2015-06-30Cleanup insert/replace mode input handlingMarc André Tanner
View should only display the file content, but not modify it.
2015-05-16Release macro dataMarc André Tanner
2015-05-16Cleanup general purpose buffer APIMarc André Tanner
Introduce buffer_init to initialize a stack allocated buffer. Rename buffer_{alloc,free} functions because they do something different than the usual convention. They operate on the underlying buffer data but do not allocate/free an actual Buffer struct.
2015-04-22Yet more renames (EditorWin -> Win)Marc André Tanner
2015-04-22More renames, no functional changesMarc André Tanner
Win -> View, window_* -> view_*
2015-04-22More renaming vis->win->view instead of vis->win->winMarc André Tanner
2015-04-22Better variable naming (VisText -> File)Marc André Tanner
Therefore vis->win->text->data becomes vis->win->file->text.
2015-04-21Improve loading of filesMarc André Tanner
This fixes a segmentation fault when opening a directory. Also, opening a file you are not permitted to read, will now give an error, instead of showing the file as empty. Based on a patch by Willem van de Krol.
2015-04-11Eliminate global state for repetition of last modificationMarc André Tanner
2015-04-11Eliminate global state for :set optionsMarc André Tanner
2015-04-11Lazy initialization of :-commandsMarc André Tanner
2015-04-07Set '< and '> marksMarc André Tanner
2015-04-05Introduce new struct VisTextMarc André Tanner
This adds yet another layer of indirection and stores vi related stuff which is associated with a given text but shared among all windows displaying it (e.g. marks). This will also help if one wants to keep texts arround which aren't currently displayed.
2015-04-03Preliminary user interface separationMarc André Tanner
In theory only ui-curses.[hc] should depend on curses, however in practice keyboard input is still handled in vis.c. Furthermore the syntax definitions as well as keyboard bindings and selection code in window.c still depends on some curses constants. There is also a slight regression in that the window status bar does not show the current mode name. This and related global state should be eliminated in the future.
2015-01-16Reorder if/else clause in order to avoid dead codeMarc André Tanner
2015-01-14Fix segfault when using arrow keys in promptMarc André Tanner
2015-01-06Rudimentary change list (accessible via g; and g,)Marc André Tanner
2015-01-02Make last insertion/replacement repeatable with '.'Marc André Tanner
2015-01-01Add rudimentary support for jump list (CTRL+{O,I})Marc André Tanner
2015-01-01Rename mark related functionsMarc André Tanner
2014-10-24Make command prompt available in visual modesMarc André Tanner
2014-10-23Move feature test macros to config.mkMarc André Tanner
2014-10-17Read stdin when given - as filenameMarc André Tanner
2014-09-25Actually set global tabwidthMarc André Tanner
2014-09-24Change split/vsplit APIMarc André Tanner
2014-09-22Add support for the '<', '>' marksMarc André Tanner
2014-09-19This fixes warning with latest glibc (>= 2.19.90), which deprecated _BSD_SOURCEChristian Hesse
warning: _BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE Commit 4f537d8e4bd9707a0048289f296510b76ce6d642 just fixed one of three cases. Fix the remaining.
2014-09-19Implement expand tab functionality, make tabwidth configurableMarc André Tanner
If expandtab is enabled then inserted tabs are replaced by tabwidth amount of spaces. Both settings apply to all windows files and can be changed via: :set tabwidth n # where 1 <= n <= 8 :set expandtab (1|yes|true)|(0|no|false)
2014-09-18Do only open an empty buffer if the file does not existMarc André Tanner
Opening a file without having read permissions should fail.
2014-09-18Clean up window splitting APIMarc André Tanner
2014-09-16Import syntax rules from sandyMarc André Tanner
2014-09-15More efficient syntax highlighting, first match winsMarc André Tanner
2014-09-14All *_free(...) functions should accept a NULL argumentMarc André Tanner
2014-09-14Fix clang static analyzer warningsMarc André Tanner
2014-09-13Rename text_insert_raw to text_insertMarc André Tanner
2014-09-13Introduce and use EPOS instead of (size_t)-1Marc André Tanner
2014-09-12Add facility to display a message to the userMarc André Tanner
2014-09-12Fix loading of not yet existing filesMarc André Tanner
2014-09-12Rename text_filename to text_filename_getMarc André Tanner
2014-09-12Restore cursor position after an undo/redoMarc André Tanner
2014-09-11Add :edit commandMarc André Tanner
2014-09-11Add :qall commandMarc André Tanner
2014-09-10Fix :q commandMarc André Tanner