Commit graph

26 commits

Author SHA1 Message Date
Alexsander Falcucci 822874fd4f
feat: support working directory via env and config (#3301) 2025-11-19 03:01:30 +01:00
fboundp 59794ff4ad
add --chdir option (#2800)
Co-authored-by: Alexsander Falcucci <alex.falcucci@gmail.com>
2025-11-12 19:40:15 +01:00
Alexsander Falcucci 79c8697236
feat: include a new icon field in the configuration file (#3274) 2025-11-03 02:10:46 +01:00
Alexsander Falcucci 1c26be7afa
feat: handling a custom icon path if provided (#3272) 2025-10-30 23:58:09 +01:00
Kindy Lin 3274502500
cli-docs: add notes for macOS (#2993) 2025-02-04 20:47:55 +07:00
crupest 9f3b6f65f7
feat: add support of Metal renderer on macOS. (#2461)
Some checks failed
Lint Website / Lint website (push) Has been cancelled
Build and Publish Website / Build Website (push) Has been cancelled
Build and Publish Website / Generate Sitemap (push) Has been cancelled
Build and Publish Website / Publish Website (push) Has been cancelled
- Add Metal renderer support on macOS.

- Update document for --opengl and --srgb.

Co-authored-by: Alexsander Falcucci <alex.falcucci@gmail.com>
2024-11-16 01:22:13 +01:00
Alexsander Falcucci 575a75acc2
feat: add mouse cursor icon option (#2834)
* fix: update cursor on macOS to I-Beam as default

- add a new cursor icon for the window
- import `nscursor` from `objc2_app_kit`
- fix missing window cursor initialization

* fix: set cursor icon to `cursoricon::text` for macos target

- removed setting cursor to `cursoricon::text` from window creation
- added setting cursor to `cursoricon::text` for macos target os

* chore: refactor codebase for more efficient imports

- remove unused import of `nscursor`

* refactor: `winit::window` imports and conditional logic

- remove the `cursor`, `cursoricon`, and `theme` imports from `winit::window`
- add the `icon` and `theme` imports to `winit::window`
- add a conditional import of `cursor` and `cursoricon` for `target_os` being `macos`

* chore: reorganize cursor imports and settings

- add `cursor` import to fix compilation error
- remove redundant `cursoricon` import declaration
- set default cursor to `cursoricon::text` for the window
- remove redundant cursor setting for macos target os

* refactor: window creation function

- remove setting the cursor to icon(text) in create_window function

* feat: implement mouse cursor icon option across the application

- add the `mouse_cursor_icon` field to `cmdlinesettings` struct
- implement `mousecursoricon` enum and `parse` method
- set the `mouse_cursor_icon` in `cmdlinesettings` from `config.rs`
- use the `mouse_cursor_icon` in `create_window` function
- update the docs to include the `mouse cursor icon` information

* docs: update documentation with new command-line reference information

- update the tldr section in the command-line-reference.md file.

* chore: refactor window module for improved imports

- remove `cursoricon` import from `winit` in `src/window/mod.rs`
- update the `window` import from `winit` in `src/window/mod.rs`
2024-10-13 19:30:32 +02:00
fredizzimo 656a487ad1
fix:! Don't fork by default (#2512)
* Don't fork by default

And, never when a tty is not attached.

* Update the documentation
2024-05-11 17:42:59 +03:00
Damian Ziemba 1b06d1f392
feat: tabs option as ENV variable and config file position + prefix cleanup for CLI argument (#2441)
* feat: read no_tabs setting from NEOVIDE_NO_TABS env variable

Signed-off-by: Damian Ziemba <nazriel@dzfl.pl>

* feat: read no-tabs setting from config file

Signed-off-by: Damian Ziemba <nazriel@dzfl.pl>

* Rename no-tabs CLI option to tabs so it aligns with other parameters.

Signed-off-by: Damian Ziemba <nazriel@dzfl.pl>

---------

Signed-off-by: Damian Ziemba <nazriel@dzfl.pl>
2024-03-26 10:55:47 +01:00
fredizzimo 4a40294fe8
Bump version to 0.12.2 (#2320) 2024-01-29 00:09:08 +02:00
Alexsander Falcucci 4765215526
feat: implement dynamic window title visibility option (#2319)
* feat: implement window title visibility control on macos

- introduced a new setting, `title_hidden`, for controlling the visibility of the window title on macos.
- the setting `neovide_title_hidden` added to allow the option to hide the window title from the command line.
- updated window builder to respect the new `title_hidden` option in the command line setting.
- documented the new `--title-hidden` flag and environment variable `neovide_title_hidden` in the command line reference.

* docs: refine macos-specific sections in documentation

- change '`window title (macos only)`' to '`title (macos only)`' in the documentation
- remove a single unnecessary line break in the documentation

* feat: refine system configuration and test tolerance

- update the command-line setting 'title hint' to 'title hidden'

* Fix ThemeChanged warning

---------

Co-authored-by: Fred Sundvik <fsundvik@gmail.com>
2024-01-28 13:50:43 +02:00
MultisampledNight af9869bd6d
release: 0.12.0 2023-12-24 11:37:40 +01:00
Travis a1d0af67a8
feat: NEOVIDE_FORK environment variable (#2189)
* formatting

* version 1: _fork and no_fork

* update documentation

* reword documentation to flow better

* version 2: fork and _no_fork

* leave description alone (on/off semantics seem weird)

* docs(cmdline): add more context to --fork and --no-fork

---------

Co-authored-by: MultisampledNight <contact@multisamplednight.com>
2023-12-23 21:41:47 +01:00
Kaylee Simmons 5743356d65
fix!: Improve render loop (#1977)
* Split the grid into separate lines

* Move scroll_region to the grid

* Add some unit tests for grid scrolling

* Use a ringbuffer to represent the grid

This optimizes the scrolling a bit, especially pure up/down.

* Draw each line as a skia picture

This currently disables smooth scrolling. Which will be re-implemented
using the scroll events and the skia pictures instead of the old
scrolling snapshots.

* Reimplement scrolling

* Use simple pd controller for scrolling

* Implement floating window transparency

This also optimizes the blurring step, to not be done unless needed.
Also removes the neovide_floating_opacity setting, since it's not clear
how that should interact with neovim's default way of dealing with
transparncy.

* Optimize the foreground drawing a bit

* Use pixel scroll offsets

* Use scroll_delta

* Draw directly without any surface

Also speed up rendering of transparent surfaces

* Remove win_viewport hack

* Remove the undocumented floating_opacity setting

* Split rendering and animation

The animate function returs a boolean that tells if the animation should
continue or not.

* Improve the event loop

All events are now processed before allowing rendering.

* Remove the redraw_scheduler

The various update functions, which are cheap to run, are always run and
return true when rendering is needed.

* Run the animation with equal and maximum step size

* Filter the frame dt by a moving average

* Use gr_context.flush_and_submit

This properly submits everything to the GPU

* Add a render thread

The default event loop on winit, at least on Windows is too slow. See
https://github.com/rust-windowing/winit/issues/2782

* Implement vsync sources

Windows using DwmFlush, Wayland using frame callbacks, a timer based
vsync when --novsync is given, and standard swap_frame otherwise.

Note on Windows, the there's some kind of race condition in the
opengl implementation and waiting for DwmFlush before swapping fixes that.

* Add some profiling blocks

* Optimize font metrics

This is done by caching the info, instead of re-calculating each time

* Fix animations only running on one Window at a time

* Document neovide far scroll lines

* Improve performance, shape only the visible lines

* Improve the scroll animation length documentation

* Document neovide_refresh_rate

* Update the actual rendered window on Flush rather than WinViewport

* Require Neovim 0.9.2

* Rename neovide_scroll_animation_far_scroll_lines to neovide_scroll_animation_far_lines

Also fix the documentation

* Remove the far scroll configuration in favor of always scrolling like normal which looks better

* Make multigrid default

* Update multigrid docs

* Review fixes

* Fix lint errors

* Fix reversed custom background condition

* refactor: removing of nestings and early returns where possible

* codestyle: calm rustfmt

* fix: remove debugging leftover override of swap interval

* feat: rename no_multigrid -> nomultigrid only on cmdline

* Revert "Remove the far scroll configuration in favor of always scrolling like normal which looks better"

This reverts commit b2ec34d12b.

* Fix far scroll direction

* feat(config)!: rename all config option sources to kebab-case

* feat!: make frame naming in config file kebab-case like cmdline

* refactor: fix typos in test names

* codestyle: calm clippy in cmdline tests

* Remove unneccessary flush command

* Add a ringbuffer struct

* Convert grid to use ringbuffer

* Implement clone_from_iter for the RingBuffer

* Make scrollback_lines use RingBuffer

* Convert actual_lines to RingBuffer

* Add iter_range to RingBuffer

* Clean up the code using iter_range

* Add size_hint to RingBuffer iterator

* fix: Improve windows creation and sizing (#2027)

* Move the window reposition code from WindowWrapper to creation

* Handle columns and lines options

* Create the window with the correct size at startup

* Support the geometry parameter

* Support setting lines and columns from init.lua/vim

* Fix the neovide channel id

* Split window creation and main loop

* Don't show the window until the final size is determined

* Improve the logging

* Make the code easier to read

* Set neovide_channel_id on all platforms

* Cleanup the grid size calculation

* docs: add unreleased yet note

* Fix new clippy warnings from rust 1.72

* Fix clippy warnings

* Try to position the floating windows inside the grid

* Reposition to messages inside the window

* Make sure that a redraw is performed when a floating window is moved

* Fix windows positioning with padding

* Refactor window padding (store it only once)

* Fix some problems with the padding

Ensure that it's always dynamically calculated. Also fix some cases
where it was calculated wrong.

* Update to Winit 0.29 master (#2035)

* Update dependencies

Winit master 0.29.1-beta#2422ea39d0e97fd43698391f84d9300cd169d8cd
Glutin 0.4.1-beta

* Fix winit breaking changes

* Do a clean exit, correctly waiting for Neovim to shut down

* Call neovide.quit at VimLeavePre instead of VimLeave

This is recommended here https://github.com/neovim/neovim/issues/7727#issuecomment-352143886.
But I don't think it has any practical difference, other than perhaps
slightly speed up the exit process.

* Fix macOS build

* Use winit throttling on Wayland instead of a custom solution

Also always redraw on RedrawRequested. This fixes the windows not
getting updated when moved in from off-screen for example.

* Fix clippy warnings

* Split neovim bridge into launch and attach phases

This makes it possible to create the window with the correct size after
it's launched, and ginit.vim/lua is processed.

* codestyle: use explicit Arc::clone

---------

Co-authored-by: MultisampledNight <contact@multisamplednight.com>

* Show the window on any grid line modification and WinViewport

* Remove UIReady callback

* Ensure that the IME is updated

* Group geometry related command line settings and update documentation

* Support resizing the window using --geometry

Both with a size from the command line and reading the size from
init.vim/lua

* Rename geometry to grid size

* Fix cmd_line tests

* Fix the unreleased yet tag that was lost during the rebase

* Move initial setup to lua (#2062)

This cleans up the code and makes it slightly faster

* fix: Fix some crashes that can happen during exit (#2076)

* Basic structure for handling errors at startup

* Special case for clap errors

* Change the startup order a bit to support building an error window

* Move startup error handling to error_handling.rs

* Create an error window

But it still does not draw anything

* Simple error text drawing

* More complex error window with scrolling

* Support copying to clipboard

* Add help text

* Use target_os instead of cfg(target) and install textlayout

For some reason cfg(target) seemed to use the wrong configuration on
WSL in some cases. It also seemed to not work when specified only for
skia, so now skia is has been move to the same location as other Os
dependent dependencies.

Also make sure that textlayout is installed on all platforms, from
packages with binaries.

* Refactor the help message

* Cleanup the code

* Handle mouse scroll

* Set default and minimum size

* Return errors from command.rs

* Handle launch errors

* Enable backtraces

* Report errors from nvim_attach

The launch and attach functions are now combined, since there's no need
to keep them splitted after some re-organization that was done.

* Report errors during setup of the neovim state

* Report errors when reading and setting the initial setting values

* Log the error messages

* Fix the tests

* Use gl and textlayout for Skia on all platforms

Egl, X11 and Wayland are not needed in our use cases.

* Cleanup and fix error reporting

Errors from Neovide were not reported correctly.

* Fix clippy warning

* Clean up the error window rendering

Don't call layout twice

* Move maybe_disown to just after command-line parsing

It's not safe to fork after threads have been created, but it still
feels more natural to output command line help in the terminal than in a
separate window, so it's delayed a little bit.

The starting of the profiler is also moved to after the fork, because it
creates threads.

* Properly fork the process on Linux and Mac

On Windows the subsystem is set to Windows, so no console is created.
The errors are always reported through the GUI.

* Fix exit crash on Windows

* Fix mixed min and default size

* Improve the crash message

* Don't panic when the event aggregator channel is closed.

Closing is a normal behaviour during shutdown, and those are the only
possible errors, so the error can safely be ignored.

* Don't panic on ParallelCommand errors

Instead log the errors to the logfile

* Don't panic when the serial and parallel send loops exit in the wrong order

* Don't panic on serial command failures

* Fix confirm quit

Neovim might exit before the response is received, so ignore all errors

* Revert "Properly fork the process on Linux and Mac"

This reverts commit 8ecc899f00.

* Don't detach/attach to the console on Windows

* Update to winit 0.29.2

---------

Co-authored-by: Fred Sundvik <fsundvik@gmail.com>
Co-authored-by: MultisampledNight <contact@multisamplednight.com>
2023-11-01 20:54:11 +02:00
LoipesMas ed58c498a9
feat: Add config file support (#1119)
Refs  #1472
Co-authored-by: Serhii Tereshchenko <serg.partizan@gmail.com>
2023-06-11 09:53:09 +03:00
LoipesMas feb9967613
fix: Fix no idle behaviour (#1889)
The argument was flipped, but the behaviour was not.
It was changed in #1885, but docs weren't updated
2023-06-07 07:49:17 +03:00
fredizzimo 68a74758f5
Disable srgb on Linux and macOS (#1885)
* Improve the code for running cmd_line tests serially

* Improve handling of vsync and srgb and fix the environment variable.

The environment variable has changed to NEOVIDE_VSYNC and NEOVIDE_SRGB,
and now works as it should. Previously NEOVIDE_NO_SRGB=1 enabled SRGB so
the environment variable value was inverted.

* Disable srgb on non-windows platforms.

* Make _nosrgb and _novsync private
2023-06-05 14:25:52 +03:00
Richard Li daf5307953
Remember windows size via pixel (#1706)
* Cargo.toml unix line ending

* added --size

* figure out initial size in draw_frame()

* refactor: Rename window_geometry -> window_size

& move parse_window_geometry

* remember window size by pixel

* updated doc

* format

* remove executable permission on random files

* changed name of size setting to avoid conflict with old version of setting

* Changed one glutin::dpi::PhysicalSize to winit
2023-04-13 21:50:13 -07:00
Kaylee Simmons 31f9ca5ab3
Bridge unix sockets and named pipes (#1828)
* Use tokio compat_write as TxWrapper.

This makes TxWrapper a misnomer. I'll rename it in a follow-up commit to
facilitate easier reviewing.

* Rename TxWrapper -> NeovimWriter.

* Bridge: Add support for Unix sockets and named pipes.

* Document the `--server` flag.

* Add --server to command line reference.

* connection.rs: Clean up parameter and return types.

* Remove unused file.

* Bridge: Introduce NeovimSession and NeovimInstance abstractions.

Hopefully this makes the connection logic easier to understand.

* Bridge: Rename connection.rs -> session.rs.

* Replace core::result::Result with std::result::Result.

* Remove await on non future for windows builds

* Fixup named pipe functionality and update feature.md docs

* Fix clippy warning

* Fix test build error

---------

Co-authored-by: khjorth <13965958+khjorth@users.noreply.github.com>
2023-04-07 17:12:56 -07:00
MultisampledNight cb21bf170f
Bump version to 0.10.2 2022-11-06 18:13:00 +01:00
multisn8 d253648e8a
Make vsync configurable (#1523)
Tries to request vsync first, and retries window creation without if it fails.
2022-10-08 13:37:12 +02:00
multisn8 57efa71501
Clean up cmdline handling (#1583)
Use clap's derive macro instead of the builder machinery
2022-10-08 12:55:45 +02:00
MultisampledNight f7ad535880
Loosely reorder command line docs to match --help 2022-09-07 14:45:01 +02:00
MultisampledNight d9e983186c
Update command line docs 2022-09-07 14:23:48 +02:00
Niklas Wimmer 63b8b8c6a7
Make x11 WM_CLASS property's instance part configurable (#1456)
It was considered to merge both parts of the property (instance and
class) into just one configuration option. This would better
reflected the inherent nature of WM_CLASS, which is also just one
option and not two.
Still, this approach was not taken because it would break backwards
compatibility, and given the low benefit it is not worth doing so.
2022-08-09 15:39:52 +02:00
Hamothy 80b9f2edd7
Transition neovide.dev to use mdbook (#1428)
Co-authored-by: Hamothy <sgoudham@gmail.com>
2022-07-30 03:59:54 -04:00