aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-08-24vis: implement gJ like behaviorMarc André Tanner4-14/+25
The behavior is not exactly the same because vim preserves any existing white spaces wihle we remove existing ones but do not insert additional ones. The vim behavior (essentially only deleating new lines) can be achived using something like: :x/\n/d Close #374
2016-08-24vis: add vis_mode_get functionMarc André Tanner2-0/+5
2016-08-24vis: improve dot (repeat) command implmentationMarc André Tanner6-16/+21
Do not override implicit operator macro in command mode. Fix #334
2016-08-24vis: improve unpaired text objectsMarc André Tanner1-6/+54
For unpaired text objects delimited by ", ' or ` if there is no preceding symbol on the same line, advance starting position to first occurence on the same line. As a result ci" can be used to change the inner quotes on the same line even if the cursor is currently to the left of the opening quote. If the line contains no such symbol at all then the text objects will will continue to match across line boundaries. This behavior is different in vim where for example a ci" command on a line without any quotes has no effect. Close #358
2016-08-24text-motions: improve matching quotation marks heuristicMarc André Tanner1-32/+55
Prefer quotation marks on the same line to when looking for matching pairs. Improves #358.
2016-08-24vis-lua: add win:draw() functionMarc André Tanner2-0/+9
2016-08-24vis: overhaul input queue handlingMarc André Tanner4-45/+30
Let vis_keys_feed always have an immediate effect. Previously, if called from a key input handler the keys would just be added to the input queue and processed once the current key handler returned. This also affects the exposed Lua API.
2016-08-20buffer: add buffer_remove implementationMarc André Tanner2-0/+12
2016-08-07text-regex: improve searching in binary dataMarc André Tanner1-20/+43
The regex(3) API we currently use, matches on NUL terminated strings. Therefore it does not work for binary data. This commit adds loops to manually skip over NUL bytes. While it does not work for patterns which would match strings containing NUL bytes, it should improve the most basic cases. Binary file handling will need further improvements in the future. Fixes #359.
2016-08-07vis: use vis-open for gf implementationMarc André Tanner1-27/+8
This has the effect that ~ and $HOME will be expanded by the shell. However it also opens files which do not yet exist. Fixes #346
2016-08-07text-object: add ` as a delimiter for file name text objectsMarc André Tanner1-1/+1
In general it might be a better idea to specify these kinds of text objects in terms of characters belonging to them rather than listing a set of delimiting characters. Fixes #350
2016-08-07view: fix screen line based motions when cursor is not visibleMarc André Tanner1-0/+4
If a cursor is not currently visible it has no associated screen line. Fallback to the corresponding logical line based variant. For example `gj` is interpreted as `j`. Fixes #354
2016-08-07Merge branch 'new-lexers-readme' of https://github.com/5paceToast/visMarc André Tanner1-1/+1
2016-08-07Mention POSIX.1-2008 as a requirement in READMEMarc André Tanner1-2/+3
Close #353
2016-08-07sam: do not change cursor position after :! commandMarc André Tanner1-1/+1
Fixes #364
2016-08-07sam: improve quoted argument parsingMarc André Tanner1-33/+28
Handling of unbalanced quotes could probably still be improved. Closes #344
2016-07-25Fix filetype table link in lexers/README.mdChloe1-1/+1
`vis.filetypes` can be found on [line 72 of `vis.lua`](https://github.com/martanne/vis/blob/master/vis.lua#L72), but is not present at all in lexer.lua. Fix `lexers/README.md` to avoid further confusion.
2016-07-15build: properly set LDFLAGS for standalone build dependenciesMarc André Tanner1-2/+2
Might fix #248
2016-07-11standalone: update to musl version 1.1.15Christian Hesse1-2/+2
2016-07-06vis: fix inner text object variants when cursor is on opening delimiterMarc André Tanner1-3/+3
Except for special cases like gn and gN vis expected that a text object would be a function mapping a position to a range as follows: f: pos -> [start, end] with start <= f(pos) <= end Clearly this condition does not hold for inner text objects when the initial position i.e. the cursor is on the opening delimiter. This also obsoletes the need for the SPLIT text object flag which should be removed in a later commit if the current behavior is found to be working as expected.
2016-06-29Merge branch 'master' of https://github.com/aeosynth/visMarc André Tanner1-1/+1
2016-06-28remove duplicate argumentJames Campos1-1/+1
2016-06-21vis-open: Add a manpage.Tim Allen2-0/+110
2016-06-17Merge branch 'vis-clipboard-manpage' of https://github.com/Screwtapello/visMarc André Tanner2-0/+107
2016-06-16vis-clipboard: Add a manpage.Tim Allen2-0/+107
2016-06-14Update the statusline when starting or ending the recording of a macroJosh Wainwright1-0/+4
2016-05-29Merge branch 'vis-open-cleanup' of https://github.com/Screwtapello/visMarc André Tanner1-16/+42
2016-05-29vis-menu: improve empty prompt handling (vis-menu -p '')Marc André Tanner1-0/+2
The textw{,n} functions should probably be changed to not accomodate for leading and trailing spaces. They should also be changed to properly calculate the display width of an UTF-8 encoded string. Currently they will just return the number of codepoints which is obviously wrong.
2016-05-29vis-menu: reduce indentation level of switch statementsMarc André Tanner1-74/+78
2016-05-29vis-menu: more cleanupMarc André Tanner1-219/+195
2016-05-29sam: use more suitable error message if no command is givenMarc André Tanner1-1/+3
2016-05-28vis: try to reduce number of redrawsMarc André Tanner5-23/+34
This is a not yet successful attempt to reduce terminal flickering when resizing windows as is for example the case when entering command mode. UI related debug output can be enabled with: $ make CFLAGS=-DDEBUG_UI=1 $ ./vis > log
2016-05-28lexer: add lexer for Google protocol buffer IDLDavid B. Lamkins2-0/+58
Close #326
2016-05-28[vis-menu] Document the initial-filter parameter.Tim Allen1-0/+8
2016-05-28[vis-open] Don't use realpath(1).Tim Allen1-1/+2
Despite how useful realpath is, apparently it's not POSIX and isn't part of the BSD userland.
2016-05-28[vis-open] Handle filenames with spaces and tabs.Tim Allen1-0/+5
We still don't handle filenames that contain newlines, but we're pressing against the limits of what portable POSIX shell can do. Besides which, we're ultimately plumbing filenames into vis-menu which uses newlines as a delimiter *anyway*, so there's not much we can do.
2016-05-28[vis-open] Actually use '--' where it's useful.Tim Allen1-1/+1
2016-05-28[vis-open] Fix '--' to actually work.Tim Allen1-0/+1
2016-05-28Rewrite vis-open to be more robust.Tim Allen1-16/+35
Rather than try to loop manually and build up a path, this new version exec's itself for each new directory scanned. Functional changes include: - We `set -e` at the top of the script, so any surprising permission-denied errors will automatically cause the script to exit with a helpful error message. - We now support the GNU "--" convention for splitting options from filename arguments, just in case somebody happens across a directory with a file named "-h" or "-p". - If launched with a single filename parameter, we automatically return it - if somebody writes ":e somepattern*" and it matches exactly one file, we might as well open it directly. - If we select a single filename parameter, we use `realpath` to build an absolute path for it - much more reliable than trying to build up a path while the user is navigating around. - If launched with a single directory parameter, we change into that directory and re-exec ourselves with ".." and all the files in that directory as arguments. This means we don't have to handle selection and recursion at the same time. - Note that if we recurse into a directory, we pass the "-f" parameter to suppress auto-selection - otherwise recursing into an empty directory would immediately select the ".." entry and pop you back out, which would be confusing. - The new version doesn't bother trying to manipulate `$VIS_MENU_ARGS` and sometimes add a prompt to it. Setting no prompt is the same as setting the prompt to an empty string, so we can just use an empty string as the default value. One specific use-case that this change cleans up is giving ":e" a pattern that matches multiple directories (for example, running ":e *e*" in the root of the vis repo). "ls -1" would list the contents of each directory (without a prefix, so you couldn't select those files) but would also print the directory names as headings followed by a colon, so you couldn't usefully select the directory names either. We get around this by only ever running "ls -1" without any arguments, so it only scans the current directory.
2016-05-28[vis-menu] Add a manpage.Tim Allen2-1/+255
Unlike the existing vis(1) manpage, this uses the `mdoc` macro set because it's (very slightly) more modern, and OpenBSD only supports `mdoc` while everybody else supports both.
2016-05-28[vis-menu] Remove unused keybinding.Tim Allen1-4/+0
I'm guessing at some point slmenu's author wanted to make the various deletion commands move text to a kill-buffer, and then Insert and Control-Y could yank from it back into the text field. That clearly never happened, though, so this is dead code.
2016-05-26ui: properly redraw status line when window focus changesMarc André Tanner1-1/+4
2016-05-26vis: use normalized absolute file names as internal representationMarc André Tanner5-30/+77
Try to display a shorthand version in the status bar, this currently only works for files below the current working directory of the editor process.
2016-05-24vis-lua: cleanup Lua status bar display codeMarc André Tanner3-17/+22
2016-05-24vis: cleanup C status bar display codeMarc André Tanner1-18/+69
2016-05-24Add utility function to calculate display width of a stringMarc André Tanner2-0/+40
This is based on the implementation of text_line_width_get from text-motions.c. There might be an opportunity for code sharing.
2016-05-24vis-lua: improve error handling when loading visrc.luaMarc André Tanner1-3/+25
If loading fails because visrc.lua is not found, then simply display an information message. However if there is a syntax error, display a complete stack trace. This fixes commit 352155889aad57f8cb6d20317ffef81073fb6533.
2016-05-24vis-lua: add debug infrastructure to trace object lifetimeMarc André Tanner1-16/+108
Output will be printed to stdout and can be enabled by: $ make debug CFLAGS=-DDEBUG_LUA=1 $ ./vis > log This commit also tries to make object creation slightly more robust.
2016-05-22vis: only display mode in status bar of active windowMarc André Tanner2-3/+4
2016-05-22vis-lua: introduce light references for short lived objectsMarc André Tanner1-7/+20
Light object references are used to type check, but contrary to full object references they are not stored in the Lua registry. This means that they are not bound to the object lifetime of their corresponding C object. Hence such objects must not be used after they have been free(3)-ed by the editor core. Such lightweight object references are always re-created, thus custom properties will not be stored across subsequent accesses. For now light object references are only used for cursor objects. This should ix the crashes introduced by the recent changes which make heavy use of the Lua API.