Sunday, September 28, 2014

Re: Patch 7.4.391 why?

On 28/09/14 22:30, Ben Fritz wrote:
> On Saturday, September 27, 2014 10:34:03 PM UTC-5, Rick Howe wrote:
>> Thank you for your help. I also tried a workaround like this.
>>
>> au WinEnter * call SetCursorLine(1)
>> au WinLeave * call SetCursorLine(0)
>> function! SetCursorLine(n)
>> let &cursorline = a:n
>> au! CursorMoved
>> if a:n && &diff && winnr('$') >= 2
>> au CursorMoved * let &cursorline = diff_hlID('.', 1) != hlID("DiffChange") && diff_hlID('.', 1) != hlID("DiffText")
>> endif
>> endfunction
>>
>
> That is a WAY more complicated workaround than just turning off cursorline on diff windows. I'd rather require a simpler workaround.
>
>>
>> However, my basic question is this patch is really reasonable or not.
>> We can still see the highlitings of hlsearch and matchparen even if cursorline in on.
>
> The difference in these, is:
>
> 1. These items rarely if ever cover an entire screen line, unlike the diff highlighting
> 2. These items can be turned off individually, unlike diff highlighting which is always on in diff mode
> 3. These items are transient, similar to cursorline
> 4. These items are visible in diff mode, unlike cursorline
>
> I think the patch is reasonable. "Show me the cursor where it is right now" is more immediate and higher priority in my mind than "show me statically what lines changed".
>
>> But why DiffChange and DiffText have to be hidden?
>> It looks incompatible.
>> I still want to see Diff highlightings in diff mode.
>>
>
> And you can if you turn off cursorline, or simply move the cursor. But you can't see cursorline unless you turn off diff, making diff mode less useful with cursorline.
>
>> Is it possible to have a new setting option like cursorline's priority?
>
> If we're going to go that far, I'd also like to be able to customize the priority of search, diff highlighting, etc. similar to controlling the priority of matches with matchadd().
>

You could even have the best of both worlds, by writing a colorscheme
where CursorLine and the various Diff* highlightings would affect
different attributes of the highlight. For instance, in either gvim or a
256-color terminal with the CSApprox plugin:

:hi CursorLine guibg=#F4F4F4
:hi clear CursorColumn | hi link CursorColumn CursorLine
:hi DiffWhatever affecting only the foreground


Best regards,
Tony.
--
Birth, copulation and death.
That's all the facts when you come to brass tacks;
Birth, copulation and death.
-- T.S. Elliot, "Sweeney Agonistes"


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: