aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-07-26view: use a mark to keep track of the visible areaMarc André Tanner1-2/+10
This should fix "corruptions" caused by wrong offsets when editing the same file in multiple windows.
2015-07-26view: do not set cursor position after resizeMarc André Tanner1-1/+0
The problem is that a cursor movement might cause a redraw which in turn causes the sidebar width to change thus the view to be resized which will override the cursor position.
2015-07-26view: always fill out complete cell matrixMarc André Tanner3-34/+26
2015-07-26vis: add infrastructure to support multiple cursors/selectionsMarc André Tanner8-370/+607
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-26text-object: add new functions to search for wordsMarc André Tanner2-0/+34
2015-07-25text: handle marks set to 0 and text_size(...)Marc André Tanner1-0/+8
2015-07-25text: add text_range_overlapMarc André Tanner2-0/+8
2015-07-24text-motion: introduce text_line_{up,down}Marc André Tanner2-0/+15
2015-07-23text-object: add text_range_linewiseMarc André Tanner2-0/+11
Takes a range and extends both ends to cover the remaining part of the line.
2015-07-22text: introduce text_range_newMarc André Tanner2-0/+10
2015-07-21ui: further separate curses related user interface codeMarc André Tanner9-36/+60
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-20vis: improve insertion of verbatim characters via CTRL-V in insert modeMarc André Tanner3-7/+144
Recognized formats are: CTRL-V nnn decimal value nnn CTRL-V onnn or CTRL-V Onnn octal value nnn CTRL-V xnn or CTRL-V Xnn hex value nn CTRL-V unnnn Unicode codepoint nnnn CTRL-V Unnnnnnnn Unicode codepoint nnnnnnnn Leading zeros can be omitted, any illegal character for the given format will be ignored and terminates the numerical code.
2015-07-19vis: handle file truncation more gracefullyMarc André Tanner5-0/+52
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-19text: move regex related functions to separate fileMarc André Tanner6-77/+88
Eventually this should probably be rewritten to use an iternal regex engine, currently it has unacceptable memory usage, it copies the whole text.
2015-07-19text: slight cleanup, add a few commentsMarc André Tanner2-23/+56
2015-07-11vis: rename struct member to avoid conflict with standard libraryMarc André Tanner2-3/+3
Closes #60
2015-07-10vis: add a file open dialogMarc André Tanner3-19/+107
For this to work make sure you have vis-open and slmenu or dmenu somewhere in $PATH. For now the file dialog is shown for :open, :split and :vsplit when the argument is either . (a dot) or looks like a file pattern. For example :open *.[ch] will show a listing of all C source and header files in the current directory. Use a fuzzy search to make your choice.
2015-07-10vis: fix detection of file changes outside the editorMarc André Tanner1-2/+2
2015-07-10text: upon successfull file save store new modification timeMarc André Tanner1-7/+11
2015-07-09ui: abstract curses related special keys awayMarc André Tanner3-7/+23
2015-07-09ui: unify backspace handlingMarc André Tanner2-9/+17
2015-07-09ui: move terminal state handling code to ui specific fileMarc André Tanner3-3/+15
2015-07-09ui: move input handling code to ui specific filesMarc André Tanner4-37/+50
2015-07-09vis: improve handling of linewise deletion at end of fileMarc André Tanner1-3/+6
dd on the last line now moves the cursor to the start of the preceding line.
2015-07-08vis: make J (join) behave like in vim when given a countMarc André Tanner1-0/+2
2015-07-08vis: only read file content from stdin if - was specifiedMarc André Tanner1-1/+1
This allows to feed keyboard input from a file as in: cat keyboard-input | vis input-file which will be used for testing purposes.
2015-07-07text: safer temporary file creationMarc André Tanner1-1/+4
Set umask before calling mkstemp. According to POSIX 2008 this is not necessary since the temporary file is guaranteed to be created with permission restricted to the current user. However this is more secure on non-conforming systems and safe as long as we do not use multiple threads. Fixes Coverity CID 101333.
2015-07-07view: properly NUL terminate whitespace replacement symbolsMarc André Tanner1-3/+3
This should not be a problem in practice, since cell->data is large enough anyway.
2015-07-07text: avoid double close in error caseMarc André Tanner1-0/+1
2015-07-07text: remove left over debugging codeMarc André Tanner1-6/+0
2015-07-06Make selection contiguous over whitespace symbolsMarc André Tanner1-2/+3
2015-07-06Warn when saving a file which has been changed outside the editorMarc André Tanner5-2/+24
2015-07-06text: remove text_load_fd and text_fd_getMarc André Tanner5-64/+33
2015-07-06Move filename from Text to FileMarc André Tanner8-65/+58
Also apply syntax rules every time the file name changes.
2015-07-06text: overhaul file load implementationMarc André Tanner1-3/+34
Files smaller than 8M are now copied into an internal buffer upon load. Thus they can be safely truncated. Larger files are memory mapped and use the file/virtual memory system as caching layer. Hence truncating them will corrupt the file content. Eventually the resulting SIGBUS should be handled gracefully.
2015-07-06text: overhaul save implemenationMarc André Tanner2-39/+207
Try to do an atomic save using rename(2) unless * the file is a symbolic link * the file is a hard link * file ownership can not be preserved * file group can not be preserved * POSXI ACL can not be preserved (if enabled) * SELinux security context can not be preserved (if enabled) in which case the file is overwritten in place. However a failure to do so results in data loss. Closes #47.
2015-07-05make: only call uname once in config.mkMarc André Tanner1-6/+8
2015-07-05text: store buffer allocation type (mmap or malloc)Marc André Tanner1-16/+33
2015-07-03Add movements to next/previous character within same lineMarc André Tanner3-0/+25
These movements always keep the cursor on the same line and do not move over newlines.
2015-07-03Do not take a snapshot in text_range_writeSilvan Jegen1-2/+0
Since text_range_write is called several times in cmd_filter, the undo command does not undo the whole filter operation but only up to the last call of text_range_write. Removing the snapshot-taking code solves this issue.
2015-07-03Remove text dump debugging codeMarc André Tanner2-19/+0
Instead use the text-dump git branch if necessary.
2015-07-03Fix handling of multibyte characters (at start of display area)David B. Lamkins1-1/+3
Previously a sequence of Unicode REPLACEMENT CHARACTER was displayed. Use an explicitly initialized mbstate_t object in the call to mbrtowc(). While this should not strictly be necessary, it works around a bug in certain implementations. Closes #56.
2015-07-03Add :show command to display special symbols for whitespacesMarc André Tanner6-17/+149
Enable/disable by setting to 0/1 respectively: :set show spaces=0 tabs=0 newlines=1
2015-06-30Fix segfault in cmd_filterMarc André Tanner1-3/+3
Using FD_ISSET on negative file descriptors results in breakage. Closes #55.
2015-06-30Perform character prev/next movements based on Text not ViewMarc André Tanner3-44/+2
While it is slower, it allows to move to characters which are currently not visible. This will be handy when experimenting with multiple cursors.
2015-06-30Cleanup insert/replace mode input handlingMarc André Tanner6-120/+69
View should only display the file content, but not modify it.
2015-06-28Do not take address of variables which go out of scopeMarc André Tanner1-4/+4
This is a bit of a hack, since now the callers range is modified. The various cmd_* functions should probably take a const Filerange pointer as argument and modify a local Filerange variable if needed.
2015-06-28Mark intentional case statement fall throughMarc André Tanner1-3/+3
2015-06-28Fix copy/paste error in text_restoreMarc André Tanner1-1/+1
This really needs some unit tests.
2015-06-28Replace a->time with a->seq in history_traverse_toRyan Chipman1-3/+3