Closed Lythenas closed 5 years ago
LGTM đź‘Ť
Unfortunately, I can’t test it since I don’t have a Mac, but @leeola could you give this branch a try?
It compiles and runs for me. Hard to say how well it works though. I get graphical artifacts, and the cursor disappears sometimes. I don't know how it should work (on Linux).
$ PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig" GNVIM_RUNTIME_PATH=$(pwd)/runtime cargo run --no-default-features
Compiling gnvim v0.1.0 (/Users/sebnow/code/gnvim)
warning: unused variable: `frame`
--> src/ui/cursor_tooltip.rs:124:27
|
124 | clone!(state, frame => move |fixed, alloc| {
| ^^^^^ help: consider prefixing with an underscore: `_frame`
|
= note: #[warn(unused_variables)] on by default
warning: unused variable: `all`
--> src/ui/cursor_tooltip.rs:366:13
|
366 | let all = format!(
| ^^^ help: consider prefixing with an underscore: `_all`
warning: method is never used: `borrow`
--> src/thread_guard.rs:23:5
|
23 | pub fn borrow(&self) -> Ref<T> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[warn(dead_code)] on by default
warning: constant item is never used: `MAX_WIDTH`
--> src/ui/cursor_tooltip.rs:50:1
|
50 | const MAX_WIDTH: i32 = 700;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: constant item is never used: `MAX_HEIGHT`
--> src/ui/cursor_tooltip.rs:51:1
|
51 | const MAX_HEIGHT: i32 = 300;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Finished dev [unoptimized + debuginfo] target(s) in 9.63s
Running `target/debug/gnvim`
Not supported option set: arabicshape
Not supported option set: ambiwidth
Not supported option set: emoji
Not supported option set: guifontset
Not supported option set: guifontwide
Not supported option set: pumblend
Not supported option set: showtabline
Not supported option set: termguicolors
Not supported option set: ext_linegrid
Not supported option set: ext_multigrid
Not supported option set: ext_hlstate
Not supported option set: ext_termcolors
Received unknown redraw event: hl_group_set
Not supported option set: ext_cmdline
Not supported option set: ext_popupmenu
Not supported option set: ext_tabline
Not supported option set: ext_wildmenu
Not supported option set: ext_messages
Not supported option set: termguicolors
Received unknown redraw event: set_icon
Received unknown redraw event: hl_group_set
Received unknown redraw event: hl_group_set
Received unknown redraw event: set_icon
Not supported option set: ext_cmdline
Not supported option set: ext_popupmenu
Not supported option set: ext_tabline
Not supported option set: ext_wildmenu
Not supported option set: ext_messages
Failed to turn input event into nvim key (keyval: 65507)
Received unknown redraw event: set_icon
Received unknown redraw event: set_icon
Received unknown redraw event: set_icon
Received unknown redraw event: set_icon
Failed to turn input event into nvim key (keyval: 65506)
Failed to turn input event into nvim key (keyval: 65507)
Failed to turn input event into nvim key (keyval: 65506)
@sebnow Could you post a screenshot of some of the graphical artifacts your getting? Is there a specific case when you get the artifacts or cursor disappearing (e.g. when the popupmenu shows, when you type in a file, etc.)?
Artifacts related to scrolling down: Ignore the font rendering issues - I haven't played around with the options yet.
I was able to replicate the cursor disappearing by using :CocList files
, going into insert mode, and escaping.
What version of pango
are you using (unless MacOS doesn’t have that; I’m assuming it does)? If you’re using version 1.44+ of pango
, try downgrading it to 1.43 if possible. See #85. Not sure if that is the problem, but it looks like it to me, so worth a shot.
Ignore the font rendering issues - I haven't played around with the options yet.
Don’t think any options can change those font issues (correct me if I’m wrong); they shouldn’t be happening, so I didn’t ignore them in my above response.
Ignore the font rendering issues - I haven't played around with the options yet.
Don’t think any options can change those font issues (correct me if I’m wrong); they shouldn’t be happening, so I didn’t ignore them in my above response.
I've had similar issues on another machine I have Gnvim installed (Manjaro Arch derivate), I'll try to reproduce and verify this might not be a OSX specific issue.
As mentioned above this is the first thing I got to compile. It is still displaying the cursor tooltip just without the webview. And I'm guessing then it should have size 0 but that might still lead to artifacts.
Because the cursor tooltip is only needed if webkit is available I will try to not display it at all.
If I understand correctly without this PR gnvim wouldn't compile on MacOS so there might be additional MacOS specific rendering issues.
@sebnow can you check again if that fixed (some of) the graphical artifacts. It would also be helpful to know if you only have these issues on MacOS or on your other machine too.
It did appear to help. It's much harder to get artifacts, but some still appear.
Ignore the font rendering issues - I haven't played around with the options yet.
Don’t think any options can change those font issues (correct me if I’m wrong); they shouldn’t be happening, so I didn’t ignore them in my above response.
I was specifically referring to the lack of some characters, as I didn't have guifont
set and my statusline requires some glyphs not present in the default font.
See #85. Not sure if that is the problem, but it looks like it to me, so worth a shot.
I don't have time to play around with it now, but it does appear to be the same issue.
How are we going to continue?
It would be good if more people (especially with MacOS) could test it but on all my machines (Arch with pango 1.43) it works as expected and without any graphical issues.
Now we need someone to test this with pango 1.43 on MacOS. Either we find (or wait for) someone who can do that or maybe @sebnow could try that when he gets the time?
It did appear to help. It's much harder to get artifacts, but some still appear.
@sebnow What are the artifacts to which you’re referring in the above screenshot?
Sorry, I should have annotated it. It's easy to miss.
Considering the font rendering issues, with some lines overlapping, it may be related.
Considering the font rendering issues, with some lines overlapping, it may be related.
It sure does look that way to me. @sebnow Would you be able to try the diff mentioned here and see if it removes the artifacts: https://github.com/vhakulinen/gnvim/issues/85#issuecomment-529230236? It isn’t a perfect fix, but it’ll remove the pango-related graphical issues enough to where you can see the issues specific to this branch (if there are any).
Put
webkit2gtk
behind a feature flag (enabled by default) which removed the documentation tooltip.Related to #8 and #110.
This is the first attempt that compiled (and if it compiles it's correct, right?). It works for me locally but maybe someone else should try it. Also someone who uses a mac could try if they can compile gnvim using the
--no-default-features
flag.I'm not familiar with gtk and this can probably be cleaned up a bit. Like not creating the tooltip at all if the feature is disabled instead of just not adding the webview.