Comments (7)
This seems to be the relevant code to save the tab labels:
" autoload/ctrlspace/workspaces.vim (lines 351-373)
for t in range(1, lastTab)
let data = {
\ "label": ctrlspace#util#Gettabvar(t, "CtrlSpaceLabel"),
\ "autotab": ctrlspace#util#GettabvarWithDefault(t, "CtrlSpaceAutotab", 0)
\ }
let ctrlspaceList = ctrlspace#api#Buffers(t)
let bufs = []
for [nr, bname] in items(ctrlspaceList)
let bufname = fnamemodify(bname, ":.")
if !filereadable(bufname)
continue
endif
call add(bufs, bufname)
endfor
let data.bufs = bufs
call add(tabData, data)
endfor
and this to load them:
" autoload/ctrlspace/workspaces.vim (lines 223-233)
for ol in oldLines
if ol ==# startMarker
let inWorkspace = 1
elseif ol ==# endMarker
let inWorkspace = 0
elseif inWorkspace
let ol = substitute(ol, "let t:ctrlspace_label", "let t:CtrlSpaceLabel", "")
let ol = substitute(ol, "let t:ctrlspace_autotab", "let t:CtrlSpaceAutotab", "")
call add(lines, ol)
endif
endfor
from vim-ctrlspace.
Perhaps the labels are saved fine, but the buffers are loaded afterwards and their names set as labels? However, why does this not happen for the first tab?
from vim-ctrlspace.
I cannot reproduce with the latest master. In cs_workspaces
there are two lines starting let t:CtrlSpaceLabel = ...
that set the tab labels of the two tabs correctly after loading the workspace.
Could you reproduce with a minimal vimrc
?
from vim-ctrlspace.
Perhaps the labels are saved fine, but the buffers are loaded afterwards and their names set as labels? However, why does this not happen for the first tab?
I'm not really sure, but I remember when I tried your repo before it was merged to master, the tab labels was working. Then I checked that your fork was already merged I installed ctrl-space again with this repo, and this happened. But I'm not really sure if I have installed some plugins or what that may be the cause of this.
I cannot reproduce with the latest master. In
cs_workspaces
there are two lines startinglet t:CtrlSpaceLabel = ...
that set the tab labels of the two tabs correctly after loading the workspace.Could you reproduce with a minimal
vimrc
?
I'll try this week.
from vim-ctrlspace.
I remember when I tried your repo before it was merged to master, the tab labels was working.
Then this could be due to my old version 8.0.1568
of Vim. Maybe it is due to
" autoload/ctrlspace/workspaces.vim (lines 388-429)
for cmd in readfile("CS_SESSION")
if cmd =~# "^lcd "
continue
elseif cmd =~# "^badd\>"
let baddList = matchlist(cmd, '\v^badd \+\d+ (\f+)$')
if exists("baddList[1]") && filereadable(baddList[1])
call add(lines, cmd)
endif
elseif
\ ((cmd =~# '^edit \f\+') && (tabIndex == 0))
\ || (!has('patch-8.1.149') && cmd =~# '^tabedit \f\+')
\ || ( has('patch-8.1.149') && cmd ==# 'tabnext')
" NB: check patch-8.1.149 for backend vim mksession change
let data = tabData[tabIndex]
if cmd =~# '^tabedit \f\+'
call add(lines, 'tabedit')
elseif cmd ==# 'tabnext'
call add(lines, cmd)
endif
for b in data.bufs
call add(lines, 'edit ' . fnameescape(b))
endfor
if cmd =~# '^tabedit \f\+'
" turn 'tabedit ...' into 'edit ...'
call add(lines, cmd[3:])
endif
if !empty(data.label)
call add(lines, "let t:CtrlSpaceLabel = '" . substitute(data.label, "'", "''","g") . "'")
endif
if !empty(data.autotab)
call add(lines, "let t:CtrlSpaceAutotab = " . data.autotab)
endif
let tabIndex += 1
else
call add(lines, cmd)
endif
endfor
from vim-ctrlspace.
Please paste the relevant lines of cs_workspaces
where the tab lables are set.
from vim-ctrlspace.
I can neither reproduce with Vim 8.1.892 > 8.1.149
. Could you check if the statusline plug-in intervenes? There are some checks for airline in the repo's code, for example.
from vim-ctrlspace.
Related Issues (20)
- File Engine Error HOT 4
- Workspace load/save only works for 1st TabList HOT 7
- Bug The workspace is not saved correctly HOT 9
- Search algorithm ranking failure HOT 3
- [Question] Are "bookmarks" and "projects" equivalent? HOT 2
- [Question] How do you manage workspaces with terminal buffers? HOT 2
- .cs_file in read only directories HOT 2
- Kudos!
- Open Ctrlspace window from command line buffer will lock the cursor in the window. HOT 2
- session-local viminfo file
- Error loading workspace HOT 3
- Add file_engine_darwin_arm support HOT 3
- Ctrl-[ is not working on CtrlSpace buffer with Kitty terminal. HOT 2
- CWD not switching upon tab switch HOT 1
- Filetype not set for additional buffers when multiple files opened HOT 17
- Linux on Apple Silicon HOT 2
- use fzf instead of custom Go compiled binaries for searching
- Telescope-like picker instead of command-line window HOT 4
- Move selection bar multiple lines at once HOT 7
- Move the selected workspace to the previous/next bookmark HOT 3
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-ctrlspace.