Comments (5)
config:
set hidden
let g:tabSystem = 'wintabs'
let g:wintabs_autoclose=1
let g:wintabs_autoclose_vim=1
let g:wintabs_switchbuf='useopen,usetab'
let g:wintabs_ui_modified*
let g:wintabs_ui_active_higroup = 'TabLineSel'
from vim-wintabs.
let g:wintabs_autoclose=2
seems to work but let g:wintabs_autoclose=1
doesn't.
from vim-wintabs.
Should be fixed in the latest commit. This is a very edge case that I can't fix completely due to how confirm/hidden interact with each other. The new behavior is that you can close a modified buffer if it's currently shown in another window or vimtab, with no confirm dialog. I think this behavior is less broken than not closing with no error/confirm.
Let me know if this is fixed for you, and if it feels "more correct" than before.
from vim-wintabs.
I'll check it out: For posterity here's the workaround I created. You might find it useful to handle some edge cases - I basically just detect whether or not there are unsaved changes before even calling wintabs#close()
. The problem is that in this workaround, if you have the file open in another split, it resets the modifications to the files to the last saved version even in the other split. I think an improvement would be to first see if the file is open anywhere else before resetting, or before even asking if they want to save changes upon 'close'.
function MaybeCloseWinTab()
if &modified
let choice = confirm("File has unsaved changes!", "&Save\n&Cancel\n&Don't Save", 2)
if choice == 3
" Don't save: Reset the file then call WintabsClose
execute "silent earlier 1f"
call wintabs#close()
elseif choice == 2 || choice == 0
" Cancel
elseif choice == 1
execute ":w"
call wintabs#close()
endif
else
call wintabs#close()
endif
endfunction
from vim-wintabs.
Closing this as I implemented your suggestion.
from vim-wintabs.
Related Issues (20)
- When restoring from Vim session, buffers from other tabs are copied into the active tab HOT 3
- [Feature request] Close tabs (buffers) to the left/right like chrome HOT 2
- Support displaying vimtabs when statusline display is enabled HOT 2
- Setting g:wintabs_display = 'none' followed by :WintabsRefresh does nothing HOT 2
- Allow overriding buf_label specifically HOT 1
- Request: Ability to click on statusline buffers HOT 1
- If two files are opened only first is displayed in wintabs HOT 3
- Option to disable tabline if only one buffer is open HOT 1
- After closing a tab, the tabbing order doesn't flow correctly
- How to exit vim after closing the last Wintabs?
- Vim error with switchbuf="useopen" in vimdiff
- Colors and styles support HOT 2
- :mkview followed by :loadview makes a buffer tab disappear
- split windows and buffers (when using g:wintabs_display = 'tabline')
- [question] change buffer status line colours HOT 1
- Buffer number HOT 1
- Strange marks in tabline HOT 1
- buffers for each tab rather than window
- persistence of folds between tabs (or buffers in a window)
- Does this project support bufferline.nvim?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-wintabs.