Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
vimagit
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
jreybert
vimagit
Commits
cf103a81
Commit
cf103a81
authored
9 years ago
by
Jerome Reybert
Browse files
Options
Downloads
Patches
Plain Diff
WIP debug
parent
3c3baa32
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
autoload/magit/state.vim
+12
-0
12 additions, 0 deletions
autoload/magit/state.vim
autoload/magit/utils.vim
+27
-0
27 additions, 0 deletions
autoload/magit/utils.vim
plugin/magit.vim
+8
-0
8 additions, 0 deletions
plugin/magit.vim
with
47 additions
and
0 deletions
autoload/magit/state.vim
+
12
−
0
View file @
cf103a81
...
...
@@ -199,6 +199,17 @@ function! magit#state#add_file(mode, status, filename, depth) dict
endif
endfunction
function
!
magit#
state
#get_files_lines
()
dict
let
lines
=
{}
for
diff_dict_mode
in
values
(
self
.
dict
)
for
file
in
values
(
diff_dict_mode
)
let
lines
[
file
.
filename
]
=
magit#
sign
#get_lines
(
\
file
.
sign_start
,
file
.
sign_end
)
endfor
endfor
return
lines
endfunction
" magit#state#update: update self.dict
" if a file does not exists anymore (because all its changes have been
" committed, deleted, discarded), it is removed from g:mg_diff_dict
...
...
@@ -284,6 +295,7 @@ let magit#state#state = {
\
'add_file'
:
function
(
"magit#state#add_file"
),
\
'set_files_visible'
:
function
(
"magit#state#set_files_visible"
),
\
'update'
:
function
(
"magit#state#update"
),
\
'get_files_lines'
:
function
(
"magit#state#get_files_lines"
),
\
'dict'
:
{
'staged'
:
{},
'unstaged'
:
{}},
\
}
This diff is collapsed.
Click to expand it.
autoload/magit/utils.vim
+
27
−
0
View file @
cf103a81
...
...
@@ -173,3 +173,30 @@ endfunction
function
!
magit#utils#
bufnr
()
return
s:bufnr
endfunction
function
!
magit#utils#set_debug
()
echom
"Log into "
.
g:magit_log_file
execute
"edit "
.
g:magit_log_file
execute
'%delete _'
write
!
let
g:magit_debug
=
1
endfunction
function
!
magit#utils#debug_cmd
(
cmd
)
if
(
g:magit_debug
!=
0
)
execute
"a:cmd"
endif
endfunc
function
!
magit#utils#debug_log
(
message
)
if
(
g:magit_debug
!=
0
)
if
(
type
(
a:message
)
==
type
(
""
)
)
let
msg
=
split
(
a:message
,
'\n'
)
elseif
(
type
(
a:message
)
==
type
({})
)
let
msg
=
split
(
string
(
a:message
),
'\n'
)
else
let
msg
=
a:message
endif
call
magit#utils#append_file
(
g:magit_log_file
,
msg
)
endif
endfunction
This diff is collapsed.
Click to expand it.
plugin/magit.vim
+
8
−
0
View file @
cf103a81
...
...
@@ -50,6 +50,10 @@ let g:magit_default_fold_level = get(g:, 'magit_default_fold_level',
let
g:magit_warning_max_lines
=
get
(
g
:,
'magit_warning_max_lines'
,
10000
)
let
g:magit_debug
=
get
(
g
:,
'magit_debug'
,
1
)
let
g:magit_log_file
=
get
(
g
:,
'magit_log_file'
,
'/tmp/vimagit.log'
)
execute
"nnoremap <silent> "
.
g:magit_show_magit_mapping
.
" :call magit#show_magit('v')<cr>"
" }}}
...
...
@@ -834,4 +838,8 @@ endfunction
command
!
Magit
call
magit#show_magit
(
'v'
)
command
!
MagitDebugFilesLines
call
magit#utils#append_file
(
g:magit_log_file
,
magit#utils#flatten
(
items
(
s:state
.
get_files_lines
())))
command
!
MagitDebug
call
magit#utils#set_debug
()
" }}}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment