vim-ags icon indicating copy to clipboard operation
vim-ags copied to clipboard

Weird highlighting characters

Open mikekreeki opened this issue 9 years ago • 20 comments

Thanks for a useful plugin!

Anyway I have some highlighting issues in Macvim. I tried to disable colors using let g:ags_agexe = 'ag --nocolor' but the issue is still there on some lines.

Any ideas?

mikekreeki avatar Apr 01 '15 07:04 mikekreeki

Do you mind pasting the raw text from the search window in here. Only what's visible in the screenshot would suffice. This could be a syntax highlighting bug.

gabesoft avatar Apr 01 '15 14:04 gabesoft

Actually when I try to do that it copies the text correctly (without any highlight markers).

Interestingly when I select a line that has correctly highlighted line number using V the highlighting markers appear. Also when I move the cursor on the line with broken highlighting it fixes it (only on some lines). Its hard to describe the issue in letters but it definitely looks like a highlighting bug.

mikekreeki avatar Apr 01 '15 14:04 mikekreeki

The nocolor option works for me when I pass it from the command line Ags --nocolor current but that's not a solution as that removes all highlighting. So, are the results the same for you with or without that option? Also, do you have a recent version of the plugin?

gabesoft avatar Apr 01 '15 15:04 gabesoft

Seems to work fine for me otherwise. screen shot 2015-04-01 at 8 29 32 am

gabesoft avatar Apr 01 '15 15:04 gabesoft

I think I have the latest version (installed yesterday).

When I run with --nocolor on command it works but has no color obviously.

If it works for you maybe some other plugin is messing with it. Will try in clean vim installation.

mikekreeki avatar Apr 01 '15 15:04 mikekreeki

One more thing, the highlight markers are used for coloring the syntax. If you want to see the raw text you can do :syntax off. But, on copy those markers are removed. You can still paste the text with the markers if you use the 0 register "0p

gabesoft avatar Apr 01 '15 15:04 gabesoft

I also wonder if this could be a vim version discrepancy. My version is

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Mar 13 2015 23:48:18)
MacOS X (unix) version
Included patches: 1-622

gabesoft avatar Apr 01 '15 15:04 gabesoft

I'm closing this as there seems to be no new input.

gabesoft avatar Apr 08 '15 01:04 gabesoft

I was seeing the same issue, both with Vim (patch 692) and NeoVim (recent version).

It looked like this:

[1;31mdocs/conf.py[0m[K
[1;30m125 [0m[K-# of the sidebar.
[1;30m126 [0m[K-#html_logo = None
[1;30m127 [0m[K-
[1;30m128 [0m[K:64:# The name of an image file (within the static path) to use as [32;40mfavicon[0m[K of the
[1;30m129 [0m[K-# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
[1;30m130 [0m[K-# pixels large.
[1;30m131 [0m[K:7:#html_[32;40mfavicon[0m[K = None
[1;30m132 [0m[K-
[1;30m133 [0m[K-# Add any paths that contain custom static files (such as style sheets) here,
[1;30m134 [0m[K-# relative to this directory. They are copied after the builtin static files,

This appears to be caused because the &filetype of the buffer is not being set, and that seems to be a consequent of using Neobundle to load the plugin after Vim startup, just with NeoBundle "gabesoft/vim-ags" (for testing it).

The file ftdetect/agsv.vim is not being sourced/used in this case.

It would require to do filetype off and filetype plugin on first.

Adding the plugin to vimrc proper (before the filetype command fixes it).

blueyed avatar Apr 11 '15 13:04 blueyed

For me the filetype for ags buffer is set correctly. My .vimrc goes like this:

" GENERAL
  set nocompatible
  filetype off

" PLUGINS
  set rtp+=~/.vim/bundle/Vundle.vim
  call vundle#begin()

  Plugin 'gabesoft/vim-ags'

  call vundle#end()

" GENERAL
  filetype plugin indent on
  syntax on

mikekreeki avatar Apr 12 '15 09:04 mikekreeki

@mikekreeki And does it look like in my paste for you? Does :filetype off, :filetype plugin indent on fix it for you? Or when you reload the file (:e)?

blueyed avatar Apr 12 '15 12:04 blueyed

@mikekreeki I still think that in your case it may be a syntax bug because only some of the lines don't get highlighted. But, I wasn't able to reproduce the problem just from the screeshot. It would help if you could paste the original text from your file.

gabesoft avatar Apr 12 '15 16:04 gabesoft

@blueyed I've got the exact same issue as you did, using pathogen, but moving the pathogen#infect() line around doesn't fix it:

execute pathogen#infect()
syntax on
filetype plugin indent on

ftdetect

Doing :set filetype=agsv fixes the rendering.

ftdetect is not being called apparently and I'm not sure why :(

ghost avatar Apr 15 '15 02:04 ghost

I was able to fix it by putting

autocmd BufWinEnter {*.agsv} syntax on

in my vimrc.

smith avatar Apr 15 '15 18:04 smith

@smith Your solution works for me too :+1:

mikekreeki avatar Apr 16 '15 08:04 mikekreeki

@smith didn't work for me (where did you put it?)

However this did:

autocmd BufNewFile,BufRead,BufEnter *.agsv set filetype=agsv

It's still a hack though.

ghost avatar Apr 17 '15 02:04 ghost

@vaskas it's somewhere in the middle :) after the Vundle setup stuff.

smith avatar Apr 22 '15 15:04 smith

When using junegunn/rainbow_parentheses.vim the above problem occurs. The filetype and syntax are correctly set to agsv.

Cheers

zamaterian avatar Oct 28 '15 13:10 zamaterian

Unfortunately, I'm not able to reproduce this. The search results display fine for me even when the rainbow parentheses are enabled. However, you could try disabling them for agse and agsv file types.

autocmd FileType agse,agsv RainbowParentheses!

gabesoft avatar Oct 29 '15 02:10 gabesoft

Thnx, thats a work around. Let me know if you want me to try out something :)

zamaterian avatar Oct 29 '15 08:10 zamaterian