Commit graph

26 commits

Author SHA1 Message Date
Alexsander Falcucci ba8c41f423
handle neovim bufwrite progress events (#3546)
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
after some debugging, stable and nightly currently encode buffer writes
differently meaning that stable has something like:

    {
      data = ...,
      id = "bufwrite",
      percent = 0,
      source = "nvim",
      status = "running",
      text = { '[file-path]' },
      title = ""
    }

against the current nightly

    {
      data = ...,
      id = 'nvim.bufwrite "[file-path]"',
      source = "nvim",
      status = "running",
      text = { '"[file-path]" ' },
      title = ""
    }

so missing percentages now finish the active progress item instead of starting
a 0% animation, while determinate progress continues to animate by id.

for example now we will show the progress bar only when a neovim producer
(a plugin or any process event that uses nvim_echo) sends a real determinate percent.

    vim.api.nvim_echo({ { "my-progress-bar." } }, true, {
      kind = "progress",
      id = "neovide-task",
      source = "plugin-name",
      percent = 25,
      status = "running",
    })
2026-08-12 01:03:06 +02:00
Alexsander Falcucci 510d7f1b8a
macos: add system window proxy icon support (#3494)
driven by the document state, we are using the NSWindow
representedFilename API's to sync the current buffer state.
2026-04-23 20:00:27 +02:00
Alexsander Falcucci 09ba278bcd
fix: don't clear hidden window titles (#3403)
First, we now set a sane default window title

we already handle title updates from nvim, but the default startup
behavior was still effectively "call everything Neovide" until
otherwise.

that's not very useful.

now, if the user hasn't configured either 'title' or 'titlestring', we enable
titles and use "%F" so the window follows the current path. *but we don't
override user configuration. if either option was already set, we leave it alone.

---

The second, "title-hidden" means "don't show the title", not "make the window
stop having one"

On macOS we got that wrong. when title hiding was enabled, we hid the
title visually and then also **cleared** the underlying NSWindow title by
setting it to an empty string.

That broke the native bookkeeping for secondary windows. The window itself
was created fine and the native tab showed up, but AppKit no longer had
a real title to use for the Window menu entry. So the second window
ended up effectively unnamed there.

we fix it by leaving the NSWindow title alone. keep the title hidden from
the titlebar, but preserve it for the platform APIs that actually need
it.
2026-03-15 21:06:07 +01:00
fredizzimo 91f8b8dbc5
fix: re-enable the IME pre-edit support (#3221)
Co-authored-by: sevenc-nanashi <sevenc7c@sevenc7c.com>
Co-authored-by: Alexsander Falcucci <alex.falcucci@gmail.com>
2026-02-04 19:30:24 +01:00
Alexsander Falcucci 236be5ca9f
feat: introduce touchpad pressure preview actions for url/file/text (#2762) 2025-11-27 06:57:31 +01:00
fredizzimo 701526fbff
fix: always auto-detect the background color, support setting the window theme (#3207)
Co-authored-by: Alexsander Falcucci <alex.falcucci@gmail.com>
2025-11-21 06:41:24 +01:00
Alexsander Falcucci 2a67ba8439
feat: inject and manage sponsor banner in neovim intro screen (#3285) 2025-11-12 17:30:36 +01:00
Alexsander Falcucci faf1d8ad37
feat: add animated progress bar with nvim_echo event support (#3279) 2025-11-09 13:20:34 +01:00
Alexsander Falcucci f1bdcdcd4b
feat: add :NeovideConfig command to open the configuration file (#3275) 2025-11-03 01:42:51 +01:00
fredizzimo af773da75e
Revert "feat: add Lua API of IME event handling (#3110)" (#3218)
This reverts commit 75ae946835.
2025-09-12 15:56:51 +03:00
kanium 75ae946835
feat: add Lua API of IME event handling (#3110)
* feat: add preedit support when enabled IME mode

related to neovide#1931

* feat: support multi-line editing when IME is enabled

* feat: add an API for handling IME events

Default action is to insert commited text after the cursor. And, you can
customize the behavior when preeditted or committed.

* Revert to previous behavior

If the text which you input is committed, process as key input
regardless of mode of neovim

* doc: update related contents of IME handling API

* feat: support sending raw text and cursor offset

* doc: add the content to enable preedit of IME

* fix: broken link in faq

* style: format ui_commands.rs

* style: format api.md and faq.md

* style: format api.md again

100 chars line len
2025-09-10 10:53:45 +03:00
fredizzimo 3075a94f2e
feat: add an API for disabling redraw (#3097)
* Add an api for temporarily disable redrawing

* Update the documentation
2025-04-06 19:57:58 +07:00
fredizzimo 7acadc18bd
Use nvim_exec2 instead of deprecated nvim_exec (#3076) 2025-04-02 19:00:53 +07:00
fredizzimo 12cde5a349
Fix file drop with open in tabs set to false (#3074) 2025-04-01 12:40:34 +07:00
Austin bc583799c0
Enabled remapping of Command+Q on macOS (#3048)
* Enabled remapping of Command+Q on macOS

* Included existing exit logic with Cmd+Q on macOS
2025-03-17 09:46:16 +01:00
fredizzimo 1eab3dc527
fix: Use drop for filedrop (#3002)
* Use drop for filedrop

* Convert to wslpath when dropping files

* Remove path quoting on non-wsl platforms
2025-02-08 16:22:47 +07:00
Luco Bellic 6d0aa1acbd
chore: format and add stylua.toml (#2823) 2024-10-07 23:24:30 +03:00
fredizzimo c7425dc49e
fix: Fix the remote clipboard support (#2696)
* Remove unneeded parameters from clipboard rpc calls

* Reload the clipboard provider

* Support the "*" register for the Neovide remote clipboard on Linux

* Cleanup tuple deconstruction
2024-07-10 18:11:46 +03:00
fredizzimo 5f9065f721
feat: Provide a neovide_version variable (#2622)
* Provide the patch version to the channel info

* Set a neovide_version variable

* Update the documentation
2024-06-02 15:13:45 +03:00
fredizzimo 7f492475b9
fix!: require Neovim 0.10.0 (#2550) 2024-05-16 15:39:17 -07:00
Kaylee Simmons 2b00f9eb5c
Send options on startup as well as on changed except for columns and rows (#2315)
* Send options on startup as well as on changed except for columns and rows

* Don't check all options when observing changes and only add an autocmd for startup once
2024-01-28 12:37:46 +02:00
fredizzimo 879172ec07
Use RPC requests instead of notify for quit requests (#2312) 2024-01-26 22:12:54 -08:00
fredizzimo b496ab23f4
fix: Scrolling of windows with winbar or native borders (#2165)
* Parse highlight infos

* Draw borders

* Unlink border highlight groups so that they can be detected by Neovim.

* Fix the cursor position in windows with borders

* Change Arc/Mutex to RC/RefCell

* Clarify the border classification

* Fix empty grid detection, taking borders into account

* Fix terminal buffers

The documentation seem to be wrong on a couple of points...

* style: let rustc infer generic

* Consider lines with any winbar highlight as borders

* Optimize the border and winbar checks

---------

Co-authored-by: MultisampledNight <contact@multisamplednight.com>
2023-12-23 22:57:39 +01:00
Chen Shuaimin 3e83b031de
Wayland clipboard (#2123)
* Fix "clipboard: provider returned invalid data"

* Use wayland clipboard
2023-11-14 16:40:02 +02:00
Kaylee Simmons b79b7cc0be
Fix remember window size (#2120) 2023-11-11 10:26:47 -08: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