aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/main.c
Commit message (Collapse)AuthorAge
...
* highlight: extract low-level highlight logic from syntax, uiBjörn Linse2018-07-21
|
* main: fix FALLTHROUGH hints (#8623)John Dallahan2018-06-22
| | | | GCC (Clang also?) does not recognize FALLTHROUGH comments when the case is wrapped in braces.
* *: Replace b_changedtick with new always-inline functionsZyX2018-06-22
| | | Ref #8474
* startup: delete empty stdin buffer if other files were openedJustin M. Keyes2018-06-18
| | | | | | | | | DWIM: avoid empty buffer 1 when stdin was empty. If other files were specified at startup, we assume that stdin is only accidentally not-a-TTY: user did not intend to send text from it. ref #8560 ref #8561
* startup: go to buffer 2 if stdin is emptyJustin M. Keyes2018-06-18
| | | | | | | | | | | | If stdin is not a TTY we read it into buffer 1, as text. But if the stdin pipe is empty, Nvim was most likely invoked for some other reason. DWIM: select buffer 2 (if it exists). Example: echo file1 | xargs nvim closes #8560 closes #8561 ref https://github.com/equalsraf/neovim-qt/issues/417
* startup: fix -E/-Es without `-u NONE`Justin M. Keyes2018-06-17
| | | | | | | | | | Before this change, -E/-Es without `-u NONE` reads stdin as Ex commands. It should always read stdin as text (into buffer 1), like this: echo foo | nvim -Es +'%p' foo echo foo | nvim -Es -u NORC +'%p' foo
* Ex mode: use getexline() instead of getexmodeline()Justin M. Keyes2018-06-17
| | | | | | | | | | | | | | | | | | | | | This changes Ex mode (Q, -e) to work like Vim's "improved Ex mode" (gQ, -E). That brings some small behavior differences, but should not impact most Ex scripts (unless, for example, they depend on mappings being disabled--but that can be solved for -e by skipping user config). Before this change: * the screen test hangs. After this change: * Q acts like gQ. * -e/-es differs from -E/-Es only in its treatment of stdin. This moves towards potentially removing getexmodeline(). (HINT: That does NOT mean "removing Ex mode", it means removing the Vi-compatible Ex mode, which differs from Vim's "improved Ex mode" only in some minor details (e.g. mappings are disabled).) ref #1089 :-)~
* doc: job/channel, misc #7783Justin M. Keyes2018-06-11
| | | | | | | | | | | doc: termios defaults. ref #6992 doc: :help shell-powershell doc: provider: Python minimum version is 2.7, 3.4 doc: remove :!start special-case. #5844 doc: mention #7917 change which accepts empty Array for Dictionary parameter doc: <Cmd> pseudokey doc: lmap change #5658 doc: -s, -es
* cleanup, test interactive -EJustin M. Keyes2018-06-04
|
* win/startup: remove --literalJustin M. Keyes2018-06-04
| | | | | | | | | | | | | | | Fixes 2 failing tests in startup_spec.lua. The Windows-only `--literal` option complicates support of "stdin-as-text + file-args" (#7679). Could work around it, but it's not worth the trouble: - users have a reasonable (and englightening) alternative: nvim +"n *" - "always literal" is more consistent/predictable - avoids platform-specific special-case Unrelated changes: - Replace fileno(stdxx) with STDXX_FILENO for consistency (not motivated by any observed technical reason).
* startup: allow explicit "-" file arg with --headlessJustin M. Keyes2018-06-04
|
* startup: fix -es/-Es so they are actually silentJustin M. Keyes2018-06-04
| | | | | | silent-mode (-es/-Es) has been broken for years. The workaround up to now was to include --headless. But --headless is not equivalent because it prints all messages, not the limited subset defined by silent-mode.
* startup: silent-mode is not `full_screen`Justin M. Keyes2018-06-04
| | | | | | | | | silent-mode (AKA batch-mode, -es/-Es) by definition should not behave like a UI. There are still some places that check `full_screen` to decide behavior, e.g. msg_start(). Future: maybe eliminate `full_screen`, check `ui_active()` instead?
* lintJustin M. Keyes2018-06-04
|
* startup: stdin-text with -E, -Es (improved Ex-mode)Justin M. Keyes2018-06-04
| | | | | | | | | | | | | | | | Special-case for -E/-Es (as opposed to -e/-es). -es/-Es is the only mode that really allows N/Vim to work as a batch script engine. Adding a new flag (say `-x`) would involve a lot of churn: -es/-Es is implemented by checking `exmode_active` in numerous places. This commit does not change -es because some scripts use it. But scripts are unlikely to use -Es because it is not functionally different from -es. Also, both -es and -Es were broken in Nvim for years and no one mentioned it...
* startup: stdin-text with file argsJustin M. Keyes2018-06-04
|
* startup: stdin as text instead of commandsJustin M. Keyes2018-06-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Treat stdin as text by default (so the "-" file is not needed): echo foo | nvim It works with file args (implemented in next commit), too: echo foo | nvim file1.txt file2.txt Why? Because: - Execution of input is (1) almost always unintentional/confusing, and (2) potentially destructive. - Avoids the need for time-delayed warning. #7659 - The _common_ case is to open text in a buffer, not send commands. Note: - Not for Ex-mode (-es) because it is used by scripts. But maybe `-Es`? - Not for --headless, because stdio may be a protocol stream and may be used for any purpose by stdioopen(). To treat stdin as Normal-mode commands, use `-s -` instead: echo ifoo | nvim -s - Other alternatives: - Replay a register. E.g. the following mostly works, except @q aborts on any "beep" (e.g. if the cursor can't move). nvim -c '%d q|norm @q' - - Future: Let `:%source` work with unsaved buffer contents? closes #2087 closes #7659
* main.c: remove check_tty(), delayed warningJustin M. Keyes2018-06-04
| | | | | | | | This code was essentially dead because this condition: (!parmp->err_isatty && (!parmp->output_isatty || !parmp->input_isatty)) is almost never true. ref #7659
* lintJustin M. Keyes2018-06-04
|
* main.c: remove useless callJustin M. Keyes2018-05-18
| | | | | Vim's vimrc_found() also handles setting 'nocompatible', that's why it does vimrc_found(NULL, NULL).
* do not pass NULL to os_getenvJustin M. Keyes2018-05-18
| | | | closes #8393
* Merge #8276 'startup: Make -s - read from stdin'Justin M. Keyes2018-04-17
|\
| * win: Fix reading from stdinb-r-o-c-k2018-04-14
| | | | | | | | | | | | | | | | * Reading from stdin on Windows is fixed in the same way as it was in #8267. * The file_read function was returning without filling the destination buffer when it was called with a non-blocking file descriptor.
| * Merge branch 'master' into s-dash-stdinb-r-o-c-k2018-04-14
| |\
| * \ Merge branch 'master' into s-dash-stdinZyX2017-12-03
| |\ \
| * | | main: Translate full -s error message, not part of itZyX2017-03-19
| | | |
| * | | fileio,main: Do not restart syscall at EAGAIN when reading for -sZyX2017-03-19
| | | |
| * | | getchar: Use fileio instead of fdopenZyX2017-03-19
| | | | | | | | | | | | | | | | | | | | | | | | Problem: as fileio is cached and reads blocks this is going to wait until either EOF or reading enough characters to fill rbuffer. This is not good when reading user input from stdin as script.
| * | | main: Temporary fix assertion errorZyX2017-03-19
| | | | | | | | | | | | | | | | | | | | This variant uses `fdopen()` which is not standard, but it fixes problem on my system. In next commit `scriptin` will use `FileDescriptor*` from os/fileio in place of `FILE*`.
| * | | main: Make `-s -` read from stdinZyX2017-03-19
| | | |
* | | | startup: ignore -XJustin M. Keyes2018-04-16
| |_|/ |/| | | | | | | | closes #8285
* | | lintJustin M. Keyes2018-04-11
| | |
* | | server: introduce --listen, deprecate $NVIM_LISTEN_ADDRESSJustin M. Keyes2018-04-11
| | |
* | | cleanup: remove main_start_gui()Justin M. Keyes2018-04-11
| | |
* | | build/msvc: Add missing WIN32 macrob-r-o-c-k2018-03-04
| | | | | | | | | | | | MSVC predefines `_WIN32`, but not `WIN32`. Also, some unnecessary includes have been removed.
* | | build/msvc: Fix standard IO file number definitionsb-r-o-c-k2018-02-28
| | | | | | | | | | | | With MSVC, STDOUT_FILENO and STDERR_FILENO are defined as function calls instead of constants, meaning they can't be assigned to enum values. The enum was only used in one file, so it has been removed. A definition for STDIN_FILENO has been added that is consistent with the other two definitions.
* | | exit: annotate FUNC_ATTR_NORETURN functions #7954 (#7954)Justin M. Keyes2018-02-07
| | | | | | | | | | | | This should fix a particular false positive from clang 5.0.0 scan-build, which thinks that nlua_init() can continue after preserve_exit().
* | | Fix warning about variable length array.George Zhao2018-01-18
| | |
* | | Fix warning about unused value.George Zhao2018-01-18
| | |
* | | *: Provide list length when allocating listsZyX2018-01-14
| | |
* | | vim-patch:8.0.0420: text garbled when the system encoding differs from ↵James McCoy2017-12-17
| |/ |/| | | | | | | | | | | | | | | | | 'encoding' Problem: When running :make the output may be in the system encoding, different from 'encoding'. Solution: Add the 'makeencoding' option. (Ken Takata) https://github.com/vim/vim/commit/2c7292dc5bbf155fe2192d417363b8c085759cad
* | tui: job-control: use saved termios for pty jobsJustin M. Keyes2017-11-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | On startup, if running in a terminal, save the termios properties. Use the saved termios for `:terminal` and `jobstart()` pty jobs. This won't affect nvim spawned outside of a terminal. questions: - This affects `:terminal` and `jobstart({'pty':v:true})`. Should we be more conservative for `jobstart({'pty':v:true})` (e.g. pass NULL to forkpty() and let the OS defaults prevail)? - Note: `iutf8` would not be set in that case.
* | channels: stderr channelBjörn Linse2017-11-25
| |
* | channels: allow bytes sockets and stdio, and buffered bytes outputBjörn Linse2017-11-24
| |
* | vim-patch:8.0.0096: has('ttyin'), has('ttyout')Justin M. Keyes2017-11-04
| | | | | | | | | | | | | | | | | | | | | | | | | | Nvim note: intentionally did not include `--ttyfail` since its purpose is not clear. (And it isn't used in any Vim test files/scripts). --- Problem: When the input or output is not a tty Vim appears to hang. Solution: Add the --ttyfail argument. Also add the "ttyin" and "ttyout" features to be able to check in Vim script. https://github.com/vim/vim/commit/2cab0e191055a8145ccd46cd52869fbb9798b971
* | 'titleold': move logic to getout()Justin M. Keyes2017-10-05
| |
* | win: expect utf8-encoded `argv` when built as a libraryJustin M. Keyes2017-08-24
| |
* | win: wmain(): use utf16_to_utf8() #7060Justin M. Keyes2017-08-24
| |
* | win: wmain(): locale-independent argv (#7180)Yuto Tokunaga2017-08-23
| | | | | | fix #7060
* | vim-patch:8.0.0680James McCoy2017-08-21
| | | | | | | | | | | | | | | | Problem: Plugins in start packages are sourced twice. (mseplowitz) Solution: Use the unmodified runtime path when loading plugins (test by Ingo Karkat, closes vim/vim#1801) https://github.com/vim/vim/commit/07ecfa64a18609a986f21d6132d04ee8934f3200