hismailbulut / Neoray

Simple and lightweight GUI client for Neovim
MIT License
148 stars 5 forks source link

Invisible cursor and strange colors #35

Open damanis opened 2 years ago

damanis commented 2 years ago

OS Ubuntu 20.04

Neoray version Neoray version: compiled 51f01a12 nvim version: NVIM v0.8.0-dev+608-g778541067

Problems

Steps to reproduce

  1. Create file:
    
    TITLE: qweqwe
    END: qweqwe

02-01-2022: text2

01-01-2022: text1

2. Add to some nvim lua init file:

vim.api.nvim_exec([[ au BufNewFile,BufRead *.txt call Detect_jdoc() fun Detect_jdoc() if getline(1) =~? "^TITLE:" || getline(2) =~? "^TITLE:" setlocal filetype=jdoc endif endfun ]], false)

3. Open the created file by Neoray several times.

**Neoray config in init.vim**
lua/settings.lua:

vim.api.nvim_exec([[ if exists('g:neoray') " Now impossible to disable cursor animation by 'NeoraySet CursorAnimTime 0' NeoraySet CursorAnimTime 0.001 NeoraySet ContextMenuOn false NeoraySet WindowSize 100x52 colorscheme uwu set guifont=Go-Mono-Nerd-Font-Complete:h11 endif ]], false)



**Debug output (you can generate starting neoray with --verbose option)**
The is no difference between Neoray_verbose.log in success and fail
hismailbulut commented 2 years ago

Thanks for detailed information. I tried but I couldn't reproduce this. Is this started happening after 51f01a1 ? Also this can be a colorscheme issue. If you updated your plugins, a bug in a plugin may also have caused this.

damanis commented 2 years ago

I didn't see the problem until try 51f01a12. Checked with different colorschemes (for example, github-nvim-theme). Others neovim GUI I use (fvim, neovim-qt, goneovim, nvui) have do problem with same configuration.

hismailbulut commented 2 years ago

So it seems this is not a Neoray issue. This is may be issue of neovim itself or some plugins you are using (I don't know if you are using related plugins for jdoc but it also may cause this) This may remain open until you find out exactly where the issue is coming from.

damanis commented 2 years ago

I checked now with neovim 0.7.2 - same behavior. It doesn't seems nvim issue. I'll update if I find something new.

damanis commented 2 years ago

@hismailbulut It is not about the issue. Now NeoraySet CursorAnimTime 0 does not work. Is there a way to disable cursor animation? Update. I see, it fixed.

damanis commented 2 years ago

Does Neoray saves some internal files (states, configs)?

hismailbulut commented 2 years ago

Does Neoray saves some internal files (states, configs)?

No, Neoray only saves some debugging files (cpu and heap profile, crash log and verbose log) Neoray never saves any config or never changes your any file in your system

damanis commented 2 years ago

@hismailbulut Do you use (during development) some debug options of GLFW? I still can't catch the problem with cursor.

hismailbulut commented 2 years ago

There are some ways you can debug this behavior Please do every step

Debug from Neoray

  1. First build neoray with debug tag, just run make build in the workspace and it will generate neoray_debug in bin folder
  2. Open debug build, reproduce issue and middle click one of the cell has issue. This will print cell info to terminal
  3. Copy cell info and put it here so I can look at it

Debug from neovim

  1. Move cursor to the same cell you middle clicked
  2. Run command :echo synIDattr(synIDtrans(synID(line("."), col("."), 1)), "fg") and put output here
  3. Run command :echo synIDattr(synIDtrans(synID(line("."), col("."), 1)), "bg") and put output here
  4. Run command :echo synIDattr(synIDtrans(synID(line("."), col("."), 1)), "name") and put output here
  5. Run command :echo synIDattr(synID(line("."), col("."), 1), "name") and put output here

Additional steps

  1. Open Neoray with command ./neoray_debug -u NORC and try to reproduce
  2. Open Neoray with command ./neoray_debug --noplugin and try to reproduce
damanis commented 2 years ago

There is output for Debug from Neoray


[TRACE] Opengl Version: 4.5 (Core Profile) Mesa 21.2.6
[TRACE] Vendor: Mesa/X.org
[TRACE] Renderer: llvmpipe (LLVM 12.0.0, 256 bits)
[TRACE] GLSL: 4.50
[TRACE] Max Texture Size: 16384
[TRACE] Neovim started with command: nvim [--embed /home/sergeyp/.bashrc]
[TRACE] Neovim version 0.8.0
[DEBUG] Calculated startup size of the neovim is 31 88
[DEBUG] Attached to neovim as an ui client
[TRACE] Initialization time: 201.510109ms
[DEBUG] Grid created: Grid(ID: 1, Number: 1, Type: Normal, Pos: 0 0, PixelPos: common.Vector2[int](X: 0, Y: 0), Size: 31 88, Window: 0, Hidden: false)
[TRACE] Loading font Go-Mono-Nerd-Font-Complete
[TRACE] Regular: /home/user/.fonts/Go-Mono-Nerd-Font-Complete.ttf
[TRACE] Bold: /home/user/.fonts/Go-Mono-Nerd-Font-Complete-Bold.ttf
[TRACE] Italic: /home/user/.fonts/Go-Mono-Nerd-Font-Complete-Italic.ttf
[TRACE] BoldItalic: /home/user/.fonts/Go-Mono-Nerd-Font-Complete-Bold-Italic.ttf
[DEBUG] Option CursorAnimTime is 0
[DEBUG] Option ContextMenuOn is false
[DEBUG] Option WindowSize is 100 52
[TRACE] Window is visible now in 805.488448ms
[DEBUG] Mouse action: press 1 0 0
[DEBUG] CellInfo (1, 0, 0): Grid(ID: 1, Number: 1, Type: Normal, Pos: 0 0, PixelPos: common.Vector2[int](X: 0, Y: 0), Size: 52 100, Window: 0, Hidden: false), Cell(Char: 35 #, AttribID: 182), Vertex(pos: common.Rectangle[float32](X: 0, Y: 0, W: 9, H: 15), tex1: common.Rectangle[float32](X: 0, Y: 0, W: 0.0021972656, H: 0.029296875), tex2: common.Rectangle[float32](X: 0, Y: 0, W: 0, H: 0), fg: common.Color[float32](R: 0.42352942, G: 0.42352942, B: 0.42352942, A: 1), bg: common.Color[float32](R: 0.07450981, G: 0.101960786, B: 0.10980392, A: 1), sp: common.Color[float32](R: 0, G: 0, B: 0, A: 0))
[DEBUG] Mouse action: release 1 0 0```
damanis commented 2 years ago

The output for 'neoray_debug -u NORC'

[TRACE] Opengl Version: 4.5 (Core Profile) Mesa 21.2.6
[TRACE] Vendor: Mesa/X.org
[TRACE] Renderer: llvmpipe (LLVM 12.0.0, 256 bits)
[TRACE] GLSL: 4.50
[TRACE] Max Texture Size: 16384
[TRACE] Neovim started with command: nvim [--embed -u NORC /home/sergeyp/.bashrc]
[TRACE] Neovim version 0.8.0
[DEBUG] Calculated startup size of the neovim is 31 88
[DEBUG] Attached to neovim as an ui client
[TRACE] Initialization time: 188.768031ms
[DEBUG] Grid created: Grid(ID: 1, Number: 1, Type: Normal, Pos: 0 0, PixelPos: common.Vector2[int](X: 0, Y: 0), Size: 31 88, Window: 0, Hidden: false)
[TRACE] Window is visible now in 231.818972ms
[DEBUG] Mouse action: press 1 0 0
[DEBUG] CellInfo (1, 0, 0): Grid(ID: 1, Number: 1, Type: Normal, Pos: 0 0, PixelPos: common.Vector2[int](X: 0, Y: 0), Size: 31 88, Window: 0, Hidden: false), Cell(Char: 35 #, AttribID: 52), Vertex(pos: common.Rectangle[float32](X: 0, Y: 0, W: 9, H: 19), tex1: common.Rectangle[float32](X: 0, Y: 0, W: 0.0021972656, H: 0.037109375), tex2: common.Rectangle[float32](X: 0, Y: 0, W: 0, H: 0), fg: common.Color[float32](R: 0.5019608, G: 0.627451, B: 1, A: 1), bg: common.Color[float32](R: 0, G: 0, B: 0, A: 1), sp: common.Color[float32](R: 0, G: 0, B: 0, A: 0))
[DEBUG] Mouse action: release 1 0 0

'neoray_debug --noplugin'

[DEBUG] CellInfo (1, 0, 0): Grid(ID: 1, Number: 1, Type: Normal, Pos: 0 0, PixelPos: common.Vector2[int](X: 0, Y: 0), Size: 52 100, Window: 0, Hidden: false), Cell(Char: 35 #, AttribID: 162), Vertex(pos: common.Rectangle[float32](X: 0, Y: 0, W: 9, H: 15), tex1: common.Rectangle[float32](X: 0, Y: 0, W: 0.0021972656, H: 0.029296875), tex2: common.Rectangle[float32](X: 0, Y: 0, W: 0, H: 0), fg: common.Color[float32](R: 0.42352942, G: 0.42352942, B: 0.42352942, A: 1), bg: common.Color[float32](R: 0.07450981, G: 0.101960786, B: 0.10980392, A: 1), sp: common.Color[float32](R: 0, G: 0, B: 0, A: 0))
[DEBUG] Mouse action: release 1 0 0
damanis commented 2 years ago

Commands from section 'Debug from neovim' did not print anything.

hismailbulut commented 2 years ago

Does the issue happens when you run with --noplugin? And those commands has to echo the attributes in neovim command line. Try :messages after commands

damanis commented 2 years ago

The issue happens both for '--noplugin' and '-u NORC' I didn't success with 'Debug from neovim', :messages didn't help too.

hismailbulut commented 2 years ago

Others neovim GUI I use (fvim, neovim-qt, goneovim, nvui) have do problem with same configuration.

Did you mean "no" here

Can you zip and upload a copy of your entire vim config and the file you are working on excluding your sensitive information?

damanis commented 2 years ago

Did you mean "no" here

Sure

hismailbulut commented 2 years ago

Sure

So I'm sorry because I misunderstood you, this is Neoray issue

damanis commented 2 years ago

I just try to open ~/.bashrc. 50% it as Ubuntu default. I tried find problem in config files - results unstable. Continue investigate configs. Debug output didn't help?

hismailbulut commented 2 years ago

Debug output didn't help?

They only helpful together with outputs of commands in Debug from neovim

hismailbulut commented 2 years ago

I can't reproduce with minimal configuration

au BufNewFile,BufRead *.txt call Detect_jdoc()

fun Detect_jdoc()
    echomsg "Detecting jdoc"
    if getline(1) =~? "^TITLE:" || getline(2) =~? "^TITLE:"
        echomsg "jdoc detected"
        setlocal filetype=jdoc
    endif
endfun

if exists('g:neoray')
    " Now impossible to disable cursor animation by 'NeoraySet CursorAnimTime 0'
    " NeoraySet CursorAnimTime 0.001
    NeoraySet ContextMenuOn false
    NeoraySet WindowSize 100x52
    " colorscheme uwu
    " set guifont=Go-Mono-Nerd-Font-Complete:h11
endif

with start command: neoray -u issue35.vim --noplugin

result: image

damanis commented 2 years ago

I found why 'echo' commands you requested are not shown - their output is empty. Probably, some error in the commands.

damanis commented 2 years ago

@hismailbulut Today I compiled source with last your changes (last commit is 0f9133ef) and currently I don't see the invisible cursor problem. I will update you if it returns.