GithubHelp home page GithubHelp logo

fugitive-azure-devops.vim's Introduction

๐Ÿ‘‹ Hi, I am Sam!

I am a full-stack software engineer currently based in New York, NY ๐Ÿ—ฝ

Some things I am working on, ordered by usefulness:

fugitive-azure-devops.vim's People

Contributors

cedarbaum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fugitive-azure-devops.vim's Issues

This plugin also fires for non Azure DEVOPS

This plugin always returns an url for any given file.

You can reproduce this by cloning a remote repository (e.g. from github) and disabling vim-rhubarb. If you try to use
:Gbrowse it tries to open an url without the host information (you can see it in the :messages. You need (at least) return an empty string in azuredevops#homepage_for_remote if the file url does not match (which results in a correct error message from fugitive not finding any matching handler).

Double encoded URLs

Hi!

The plugin is not really working for me, because it appears spaces in the project name are double encoded and end up like %2520.

Backwards incompatible change in URL encoding

After auditing the 8 :GBrowse providers I'm aware of and discovering 7 of them do not handle URL encoding, I've decided that Fugitive should take responsibility for this. Unfortunately this means you drew the short straw. I am recommending this change to compensate:

diff --git i/autoload/azuredevops.vim w/autoload/azuredevops.vim
index cb65262..3b80920 100644
--- i/autoload/azuredevops.vim
+++ w/autoload/azuredevops.vim
@@ -113,7 +113,7 @@ function! s:add_query_param(url, param_name, param_value) abort
   return url_base . query_param
 endfunction
 
-" Snippet from vim-rhubarb (https://github.com/tpope/vim-rhubarb/blob/master/autoload/rhubarb.vim, commit 70713ca)
+" Modified snippet from vim-rhubarb (https://github.com/tpope/vim-rhubarb/blob/master/autoload/rhubarb.vim, commit 70713ca)
 function! s:url_encode(str) abort
-  return substitute(a:str, '[?@=&<>%#/:+[:space:]]', '\=submatch(0)==" "?"+":printf("%%%02X", char2nr(submatch(0)))', 'g')
+  return substitute(substitute(a:str, '[?@=&<>#/:+[:space:]]\|%\%(\x\x\)\@!', '\=printf("%%%02X", char2nr(submatch(0)))', 'g'), '%20', '+', 'g')
 endfunction

This will continue to work on older versions of Fugitive too, except when the filename or commit contains a valid %AB URL escape. This was previously broken on the other seven providers, and nobody seemed to notice, so I doubt they are very common in practice.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.