Code Monkey home page Code Monkey logo

Comments (2)

motephyr avatar motephyr commented on June 3, 2024

I read the source code and figure out the reason.

function! s:Autosave(timed)
  if index(g:workspace_autosave_ignore, &filetype) != -1 || &readonly || mode() == 'c' || pumvisible()
    return
  endif

  let current_time = localtime()
  let s:last_update = get(s:, 'last_update', 0)
  let s:time_delta = current_time - s:last_update

  if a:timed == 0 || s:time_delta >= 1
    let s:last_update = current_time
    checktime  " checktime with autoread will sync files on a last-writer-wins basis.
    call s:UntrailSpaces()
    call s:UntrailTabs()
    silent! doautocmd BufWritePre %  " needed for soft checks
    silent! update  " only updates if there are changes to the file.
    if a:timed == 0 || s:time_delta >= g:workspace_autosave_au_updatetime
      silent! doautocmd BufWritePost %  " Periodically trigger BufWritePost.
    endif
  endif
endfunction

That is why we can't redo, because the file changed.

    call s:UntrailSpaces()
    call s:UntrailTabs()

Could we just autosave it and not to do this behavior?

from vim-workspace.

motephyr avatar motephyr commented on June 3, 2024
let g:workspace_autosave = 1
let g:workspace_autosave_untrailspaces = 0
let g:workspace_autosave_untrailtabs = 0

That works for me. But I think we can remind users in the readme

from vim-workspace.

Related Issues (20)

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.