{"action":"created","issue":{"url":"https://api.github.com/repos/dhruvasagar/vim-table-mode/issues/45","labels_url":"https://api.github.com/repos/dhruvasagar/vim-table-mode/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/dhruvasagar/vim-table-mode/issues/45/comments","events_url":"https://api.github.com/repos/dhruvasagar/vim-table-mode/issues/45/events","html_url":"https://github.com/dhruvasagar/vim-table-mode/issues/45","id":50760316,"number":45,"title":"Inserting a new column with I adds header border row","user":{"login":"idbrii","id":43559,"avatar_url":"https://avatars.githubusercontent.com/u/43559?v=3","gravatar_id":"","url":"https://api.github.com/users/idbrii","html_url":"https://github.com/idbrii","followers_url":"https://api.github.com/users/idbrii/followers","following_url":"https://api.github.com/users/idbrii/following{/other_user}","gists_url":"https://api.github.com/users/idbrii/gists{/gist_id}","starred_url":"https://api.github.com/users/idbrii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idbrii/subscriptions","organizations_url":"https://api.github.com/users/idbrii/orgs","repos_url":"https://api.github.com/users/idbrii/repos","events_url":"https://api.github.com/users/idbrii/events{/privacy}","received_events_url":"https://api.github.com/users/idbrii/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-12-03T01:28:29Z","updated_at":"2015-01-18T01:43:57Z","closed_at":null,"body":"If I use :TableModeEnable and create a simple table:\r\n\r\n\t| a | b |\r\n\r\nThen, from normal mode I type `I|` to begin inserting a new first column (I want to add a new cell to the table before 'a'), my text is transformed into a header row:\r\n\r\n\t|---+---|\r\n\r\nI would expect:\r\n\r\n\t|| a | b |\r\n\r\nSo if I kept typing `z` I would get:\r\n\r\n\t| z | a | b |\r\n\r\n\r\nI have similar problems when using `I|` with a block selection to insert a new column on several lines too. (First line is header row and the right thing happens for other rows.)\r\n\r\nI would guess this is because table-mode is seeing two adjacent Bar characters and interpreting that as a header. Is it possible to require that the last inserted character is the right Bar? (From the help, I assumed `||` would act like an imap, but it is not an imap.)\r\n\r\nMaybe you could check the current and previous characters under the cursor?\r\n\r\n    getline('.')[col('.')-2:col('.')-1] == '\\|\\|'\r\n\r\n(Not sure how that would fit in your double bar detection code.)\r\n\r\nIt could be cool if table mode detected this pattern and did the right thing for all header border rows (fills them in with header filler instead of taking them as a single cell), but I'm not sure how you'd handle subsequent input (which would be inserted inside the header row)."},"comment":{"url":"https://api.github.com/repos/dhruvasagar/vim-table-mode/issues/comments/70392903","html_url":"https://github.com/dhruvasagar/vim-table-mode/issues/45#issuecomment-70392903","issue_url":"https://api.github.com/repos/dhruvasagar/vim-table-mode/issues/45","id":70392903,"user":{"login":"dhruvasagar","id":88258,"avatar_url":"https://avatars.githubusercontent.com/u/88258?v=3","gravatar_id":"","url":"https://api.github.com/users/dhruvasagar","html_url":"https://github.com/dhruvasagar","followers_url":"https://api.github.com/users/dhruvasagar/followers","following_url":"https://api.github.com/users/dhruvasagar/following{/other_user}","gists_url":"https://api.github.com/users/dhruvasagar/gists{/gist_id}","starred_url":"https://api.github.com/users/dhruvasagar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhruvasagar/subscriptions","organizations_url":"https://api.github.com/users/dhruvasagar/orgs","repos_url":"https://api.github.com/users/dhruvasagar/repos","events_url":"https://api.github.com/users/dhruvasagar/events{/privacy}","received_events_url":"https://api.github.com/users/dhruvasagar/received_events","type":"User","site_admin":false},"created_at":"2015-01-18T01:43:57Z","updated_at":"2015-01-18T01:43:57Z","body":"Hey I haven't been able to dig around to fix this issue, but i'd like to add that all you need to do is add a 'space' or some 'text' before you add the initial `|` and that works like expected (as a work around for now)"}}