Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DogeCreateDocStandard (command) #70

Merged
merged 11 commits into from
Dec 28, 2019
Merged

Add DogeCreateDocStandard (command) #70

merged 11 commits into from
Dec 28, 2019

Conversation

mg979
Copy link
Contributor

@mg979 mg979 commented Dec 11, 2019

For custom template generation.

For custom template generation.
let l:path .= '/after/ftplugin/' . l:this_ft . '.vim'
endif
if filereadable(l:path)
exe 'split' fnameescape(l:path)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since I use buffer tabs instead of windows, I suggest you open a tab if &showtabline != v:false, otherwise, use split.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please let's keep it simple, <c-w>T can be used to move the buffer to a new tab if desired.

Copy link
Owner

@kkoomen kkoomen Dec 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can do enew for a new buffer or split for a new window. That's a small adjustment I require to be supported.

@kkoomen
Copy link
Owner

kkoomen commented Dec 12, 2019

The command doesn't work for me. See demo.

Kapture 2019-12-12 at 10 07 04

@mg979
Copy link
Contributor Author

mg979 commented Dec 12, 2019

The command doesn't work for me. See demo.

Maybe you have clipboard=unnamedplus or something like that?
Can you try changing these lines?

  call setreg('"', l:doc)
  1
  normal! P'[=']

to

  call setreg('"', l:doc)
  1
  normal! ""P'[=']

- use new tab
- check for existing but unsaved buffer
- explicit register
@mg979
Copy link
Contributor Author

mg979 commented Dec 12, 2019

I fixed that cliboard problem and set it to use a new tab, I didn't understand that thing with &showtabline, you can change it to what you prefer.

@kkoomen
Copy link
Owner

kkoomen commented Dec 12, 2019

Maybe you have clipboard=unnamedplus or something like that?

I have set clipboard=unnamed.

I didn't understand that thing with &showtabline

See :h showtabline. If it's 1 or 2 then it means the user has enabled it. If it's 0 it means it's disabled, so you can simply do:

if &showtabline != v:false
  exe 'tabedit' fnameescape(l:path) 
else
  exe 'split' fnameescape(l:path) 
endif

@kkoomen
Copy link
Owner

kkoomen commented Dec 12, 2019

Pulling 293ac4c fixes the problem indeed. Can you implement the above code I mentioned?

@kkoomen
Copy link
Owner

kkoomen commented Dec 12, 2019

Are there any other things that needs to be done or need to be taken into consideration? If not, I'll write a test for this command soon.

@mg979
Copy link
Contributor Author

mg979 commented Dec 12, 2019

Is support for external programs for documentation generation implemented? If yes, the command could take it into account.

@kkoomen
Copy link
Owner

kkoomen commented Dec 13, 2019

Is support for external programs for documentation generation implemented? If yes, the command could take it into account.

The only one we support now is clang for C-family languages. The only thing you have to adjust within the doc standard someone is extending is whether it has the generator key. If so, this will replace the match and tokens key in exchange for a generator key. You can see what I mean here.

@kkoomen
Copy link
Owner

kkoomen commented Dec 18, 2019

@mg979 I think that I will write tests for this and merge this. Agree?

@mg979
Copy link
Contributor Author

mg979 commented Dec 27, 2019

@kkoomen sorry I haven't time for this atm, the command is complete, if you need to make some adjustment you can make them by yourself.

@kkoomen kkoomen merged commit 5f10f0e into kkoomen:feature/rewrite-ftplugin-structure Dec 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants