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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
jreybert
vimagit
Commits
996c70f9
Commit
996c70f9
authored
9 years ago
by
Jerome Reybert
Browse files
Options
Downloads
Patches
Plain Diff
autoload/magit/utils.vim: add magit#utils#clear_undo function
parent
289b907e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
autoload/magit/utils.vim
+15
-0
15 additions, 0 deletions
autoload/magit/utils.vim
with
15 additions
and
0 deletions
autoload/magit/utils.vim
+
15
−
0
View file @
996c70f9
...
@@ -35,6 +35,21 @@ function! magit#utils#lcd(dir)
...
@@ -35,6 +35,21 @@ function! magit#utils#lcd(dir)
execute
s:magit_cd_cmd
.
a:dir
execute
s:magit_cd_cmd
.
a:dir
endfunction
endfunction
" magit#utils#clear_undo: this function clear local undo history.
" vimagit wants to clear undo history after each changes in vimagit buffer by
" vimagit backend.
" Use this function with caution: to be effective, the undo must be ack'ed
" with a change. The hack is the line
" exe "normal a \<BS>\<Esc>"
" If the cursor is on a closed folding, it will open it!
function
!
magit#utils#clear_undo
()
let
old_undolevels
=
&
l
:
undolevels
setlocal
undolevels
=
-1
exe
"normal a \<BS>\<Esc>"
let
&
l
:
undolevels
=
old_undolevels
unlet old_undolevels
endfunction
" magit#utils#system: wrapper for system, which only takes String as input in vim,
" magit#utils#system: wrapper for system, which only takes String as input in vim,
" although it can take String or List input in neovim.
" although it can take String or List input in neovim.
" INFO: temporarly change pwd to git top directory, then restore to previous
" INFO: temporarly change pwd to git top directory, then restore to previous
...
...
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