aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/main.c
Commit message (Collapse)AuthorAge
...
* memory: Add `free` wrapper and refactor project to use itThiago de Arruda2015-04-13
| | | | | | We already use wrappers for allocation, the new `xfree` function is the equivalent for deallocation and provides a way to fully replace the malloc implementation used by Neovim.
* os_scandir: fname_case -> path_fix_caseScott Prager2015-03-31
| | | | | | | | | | Use os_scandir(). fname_case() only gets used when `defined(USE_FNAME_CASE)` (on operating systems with case-insensitive file systems), but may be useful in other contexts, so move it to path.c. (See the TODO.) Remove the unused parameter, len.
* eval: Refactor vimscript job control APIThiago de Arruda2015-03-29
| | | | | | | | | | - Remove JobActivity autocmd and v:job_data variable - Simplify `jobstart` to receive: - An argument vector - An optional dictionary which may contain any of the current `jobstart` options plus `on_stdout`, `on_stderr` and `on_exit` callbacks. - Refactor and add more job tests - Update documentation
* terminal: New module that implements a terminal emulatorThiago de Arruda2015-03-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit integrates libvterm with Neovim and implements a terminal emulator with nvim buffers as the display mechanism. Terminal buffers can be created using any of the following methods: - Opening a file with name following the "term://[${cwd}//[${pid}:]]${cmd}" URI pattern where: - cwd is the working directory of the process - pid is the process id. This is just for use in session files where a pid would have been assigned to the saved buffer title. - cmd is the command to run - Invoking the `:terminal` ex command - Invoking the `termopen` function which returns a job id for automating the terminal window. Some extra changes were also implemented to adapt with terminal buffers. Here's an overview: - The `main` function now sets a BufReadCmd autocmd to intercept the term:// URI and spawn the terminal buffer instead of reading the file. - terminal buffers behave as if the following local buffer options were set: - `nomodifiable` - `swapfile` - `undolevels=-1` - `bufhidden=hide` - All commands that delete buffers(`:bun`, `:bd` and `:bw`) behave the same for terminal buffers, but only work when bang is passed(eg: `:bwipeout!`) - A new "terminal" mode was added. A consequence is that a new set of mapping commands were implemented with the "t" prefix(tmap, tunmap, tnoremap...) - The `edit` function(which enters insert mode) will actually enter terminal mode if the current buffer is a terminal - The `put` operator was adapted to send data to the terminal instead of modifying the buffer directly. - A window being resized will also trigger a terminal resize if the window displays the terminal.
* doc: Misc. cleanupJustin M. Keyes2015-03-24
| | | | | | | | | | Add missing parentheses and whatnot, move dangling comment, etc. Some specific items worth mentioning: Fixed some references to non-existent tags, found via `make html` msgpack_rpc/channel.c: ELOG already prefixes each line with "error @ ..."
* Remove `--nofork` / `-f` remnantsMichael Reed2015-03-24
|
* refactor: split some more functions from misc1.cbobtwinkles2015-03-24
| | | | | | | | | | | This commit pulls the some environment-variable handling functions out of misc1.c and in to os/env.c. Previously submited as #1231, this is the start of a patch series that does that work based on a more up-to-date master branch. Major tasks accomplished: - move functions and fix includes - fix clint/clang analysis warnings - correct documentation comments
* main: Simplify code that deals with early user inputThiago de Arruda2015-03-18
| | | | | | | | | A read stream will be started before the first ex command is processed. This stream will be used to read early user input before handling control over to the UI module. Which stdio stream will be used depends on which types of file descriptors are connected, and whether the "-" argument was passed.
* main: Start stdin before sourcing startup scriptsThiago de Arruda2015-03-17
| | | | | This is required to be compatible with plugins that ask user questions at startup(eg: vim-addon-local-vimrc)
* ui: Replace cursor_{on,off} by busy_{stop,start}Thiago de Arruda2015-03-15
| | | | | | | | | | | | | | | | | | | | | | | | Switching cursor off is only necessary in two occasions: - When redrawing to avoid terminal flickering - When the editor is busy The first can now be handled by the TUI, so most calls to ui_cursor_off can be removed from the core. So, before this commit it was only necessary to switch the cursor off to notify the user that nvim was running some long operation. Now the cursor_{on,off} functions have been replaced by busy_{stop,start} which can be handled in a UI-specific way(turning the cursor off or showing a busy indicator, for example). To make things even more simpler, nvim is always busy except when waiting for user input or other asynchronous events: It automatically switches to a non-busy state when the event loop is about to be entered for more than 100 milliseconds. `ui_busy_start` can be called when its not desired to change the busy state in the event loop (As its now done by functions that perform blocking shell invocations).
* Interface cleanup: Symlink handling & docsMichael Reed2015-03-12
| | | | | | | | | | | | | | | | | | | | | | This removes the ability to start nvim via the following aliases in favor of just using their command line arguments: ex vim -e exim vim -E view vim -R gvim vim -g gex vim -eg gview vim -Rg rvim vim -Z rview vim -RZ rgvim vim -gZ rgview vim -RgZ This also removes Vi mode (-v) for consistency. From ':help -v': -v Start Ex in Vi mode. Only makes a difference when the executable is called "ex" or "gvim". For gvim the GUI is not started if possible.
* refactor: Remove term modules and termcap optionsThiago de Arruda2015-02-21
| | | | | | | | | | | | | | | - Removed term.c, term.h and term_defs.h - Tests for T_* values were removed. screen.c was simplified as a consequence(the best strategy for drawing is implemented in the UI layer) - Redraw functions now call ui.c functions directly. Updates are flushed with `ui_flush()` - Removed all termcap options(they now return empty strings for compatibility) - &term/&ttybuiltin options return a constant value(nvim) - &t_Co is still available, but it mirrors t_colors directly - Remove cursor tracking from screen.c and the `screen_start` function. Now the UI is expected to maintain cursor state across any call, and reset it when resized. - Remove unused code
* ui: Rewrite the builtin terminal UIThiago de Arruda2015-02-16
| | | | | Now all terminal-handling code was moved to src/nvim/tui, which implements a new terminal UI based on libtermkey and unibilium
* ui: Remove/adapt some old code for a big UI refactorThiago de Arruda2015-02-16
| | | | | | | | | | | | | - Remove abstract_ui global, now it is always active - Remove some terminal handling code - Remove unused functions - Remove HAVE_TGETENT/TERMINFO/TERMIOS/IOCTL #ifdefs - Remove tgetent/terminfo from version.c - Remove curses/terminfo dependencies - Only start/stop termcap when starting/exiting the program - msg_use_printf will return true if there are no attached UIs( messages will be written to stdout) - Remove `ex_winpos`(implement `:winpos` with `ex_ni`)
* Remove vimdiffMichael Reed2015-02-03
| | | | | | | While we're here: - Remove references to the '+diff' feature, which has since been made non-optional. - Update a few Vim instances with Nvim.
* main.c: usage() improvementMichael Reed2015-02-03
| | | | | | | | | | | | | | | - Factor out main_msg() in favor of mch_msg() and manual indentation, as to provide a much closer representation to the actual output of '--help'. 'gcc -E' reveals that main_msg() only consists of 3 printf calls anyways. - Factor out for loop used for printing top part of usage text; just print the text normally. usage() text: - Don't print the version; that's what '--version' is for. - Be consistent about nomenclature, e.g. '<arg>' denotes required argument, '-h | --help' denotes '-h' and '--help' are equivalent, etc. - Change some instances of vim{,rc,info} to nvim
* main.c: Misc. improvementsMichael Reed2015-01-23
| | | | | | | | | | | | | | | | | | | | | | | | - Constify parameters and reduce char_u usage - Modernize function signatures - Modernize function comment blocks, rewriting if needed - Factor out mainerr_arg_missing(); all the other ME_* macros lack such a wrapper function. main_errors[] - Remove unneeded parentheses - Remove an unused error string and its respective macro mainerr() - Don't print version when called. mainerr() only handles errors related to command line arguments, so the version isn't much help at all. - Changed 'vim' instance to 'nvim' Misc. - Remove duplicate include - Replace unneeded 'inttypes.h' include with 'stdint.h' - Remove stray comments - Remove excessive newlines
* main.c: Enable -WconversionMichael Reed2015-01-23
|
* Remove easy modeFelipe Morales2015-01-15
|
* Merge pull request #1816 from Pyrohh/macro_cleanupJustin M. Keyes2015-01-15
|\ | | | | Macro cleanup
| * Macro cleanup: HAS_SWAP_EXISTS_ACTIONMichael Reed2015-01-14
| | | | | | | | | | | | | | Neovim always ships with all features[0], so this serves no purpose. Besides, this always evaluated to true. [0]: https://github.com/neovim/neovim/wiki/Differences-from-vim
* | main: Fix color schemes for abstract_uiThiago de Arruda2015-01-13
|/ | | | | | | | | - Set 't_Co' to 256 at startup. The value can be changed by the user for compatibility with terminals that are less capable. - `has('gui_running')` will return 1 if at least one rgb UI is attached. Even though these changes are hacky, they are necessary to make the transition to the new UI architecture smoother.
* Remove QNX/pterm remnantsMichael Reed2015-01-11
| | | | | The function qnx_init() (wrapped in an ifdef in main.c) doesn't even exist.
* Remove Amiga remnantsMichael Reed2014-12-19
| | | | | | | | | Notes regarding the removal of specific items: - Aztec C: only on the Amiga. - mch_check_win(): doesn't exist anymore. - Comment in ex_cmds.c: It seems the context for this comment was removed, but the comment was inadvertantly left alone.
* Use ARRAY_SIZE where Coccinelle wasn't able to do itFelipe Oliveira Carvalho2014-12-18
|
* main.c: remove NO_VIM_MAINJustin M. Keyes2014-12-13
| | | | It is from legacy Vim, not used by Neovim.
* Ignore compatible modeJoel Teichroeb2014-12-13
|
* Allow building as a static -fPIC libraryoakes2014-12-12
|
* ui: Add abstract_ui termcap and split UI layerThiago de Arruda2014-12-08
| | | | | | | | | | | | | | | | | | This is how Nvim behaves when the "abstract_ui" termcap is activated: - No data is written/read to stdout/stdin by default. - Instead of sending data to stdout, ui_write will parse the termcap codes and invoke dispatch functions in the ui.c module. - The dispatch functions will forward the calls to all attached UI instances(each UI instance is an implementation of the UI layer and is registered with ui_attach). - Like with the "builtin_gui" termcap, "abstract_ui" does not contain any key sequences. Instead, vim key strings(<cr>, <esc>, etc) are parsed directly by input_enqueue and the translated strings are pushed to the input buffer. With this new input model, its not possible to send mouse events yet. Thats because mouse sequence parsing happens in term.c/check_termcodes which must return early when "abstract_ui" is activated.
* term: Move more mouse functions to mouse.cThiago de Arruda2014-12-02
|
* term: Move "set_shellsize" to screen.c as "screen_resize"Thiago de Arruda2014-12-02
|
* mch_early_init() -> early_init().Scott Prager2014-11-28
| | | | | Move general initialization functions to early_init, which simplifies test/unit/helpers.lua, which requires all these functions.
* mch_init -> term_initScott Prager2014-11-28
|
* ui: Remove ui_delay, ui_breakcheck and ui_set_shellsizeThiago de Arruda2014-11-27
| | | | | These functions only used to call another os_* function, so remove them and replace all occurences in the project.
* iconv: re-enableNicolas Hillegeer2014-11-06
| | | | | This seems to have been disabled in the transition from vim to neovim, re-enable it.
* msgpack-rpc: Create subdirectory for msgpack-rpc modulesThiago de Arruda2014-10-21
| | | | | Create the msgpack_rpc subdirectory and move all modules that deal with msgpack-rpc to it. Also merge msgpack_rpc.c into msgpack_rpc/helpers.c
* vim-patch:7.4.439 #1245Naveen Kumar Molleti2014-10-16
| | | | | | | | Problem: Duplicate message in message history. Some quickfix messages appear twice. (Gary Johnson) Solution: Do not reset keep_msg too early. (Hirohito Higashi) https://code.google.com/p/vim/source/detail?r=v7-4-439
* Replace FOR_ALL_WINDOWS with FOR_ALL_WINDOWS_IN_TAB(curtab)Wayne Rowcliffe2014-09-24
|
* FOR_ALL_WINDOWS_IN_TAB and local variables in FOR_ALL_TAB_WINDOWSWayne Rowcliffe2014-09-22
|
* vim-patch:7.4.312Scott Prager2014-09-13
| | | | | | | Problem: Cannot figure out what argument list is being used for a window. Solution: Add the arglistid() function. (Marcin Szamotulski) https://code.google.com/p/vim/source/detail?r=v7-4-312
* api/msgpack-rpc: Refactor metadata object constructionThiago de Arruda2014-09-12
| | | | | | | | | Instead of building all metadata from msgpack-gen.lua, we now merge the generated part with manual information(such as types and features). The metadata is accessible through the api method `vim_get_api_info`. This was done to simplify the generator while also increasing flexibility(by being able to add more metadata)
* main: Rename --embedded-mode and --api-msgpack-metadata optionsThiago de Arruda2014-09-12
| | | | | --embedded-mode -> --embed --api-msgpack-metadata -> --api-info
* Additional FOR_ALL_WINDOWS usageWayne Rowcliffe2014-09-08
|
* fileinfo: rename os_get_file_info{,_link,_fd}Stefan Hoffmann2014-08-31
|
* api: Implement '--embedded-mode' command-line optionThiago de Arruda2014-08-28
| | | | | This option makes nvim run in "embedded mode", which creates an API channel via stdin/stdout and disables all terminal-related code
* FOR_ALL_BUFFERS use locally declared buffer pointerWayne Rowcliffe2014-08-17
|
* Add FOR_ALL_BUFFERS helperWayne Rowcliffe2014-08-02
|
* Statically allocate NameBuffWayne Rowcliffe2014-07-22
|
* startuptime: print vim -> nvimNicolas Hillegeer2014-07-20
|
* startuptime: always enable startuptimeNicolas Hillegeer2014-07-20
| | | | Removes the STARTUPTIME define.