Difference between revisions of "Adding new 'option'"

From Vifm Wiki
Jump to: navigation, search
m (Adding a local option: Fix closing <code> tag)
(Adding a local option: FileView -> view_t)
 
Line 16: Line 16:
 
==== Adding a local option ====
 
==== Adding a local option ====
  
# Add it to <code>FileView</code> structure in ui.h: <code>&lt;type&gt; &lt;name&gt;, &lt;name_g&gt;;</code>.
+
# Add it to <code>view_t</code> structure in ui.h: <code>&lt;type&gt; &lt;name&gt;, &lt;name_g&gt;;</code>.
 
# Add it to <code>init_view()</code> or <code>reset_view()</code> function in <code>filelist.c</code>.
 
# Add it to <code>init_view()</code> or <code>reset_view()</code> function in <code>filelist.c</code>.
 
# Add it to <code>write_options()</code> function in <code>cfg/info.c</code>.
 
# Add it to <code>write_options()</code> function in <code>cfg/info.c</code>.

Latest revision as of 20:05, 11 August 2017

Adding a global option[edit]

  1. Add it to config structure in cfg/config.h.
  2. Add it to init_config() function in cfg/config.c initializing with default value.
  3. Add it to write_options() function in cfg/info.c.
  4. Add it in opt_handlers to options array.
  5. Implement.
  6. Add it to vim/doc/app/vifm-app.txt (don't forget to update modification date).
  7. Add it to vifm.1 (don't forget to update modification date).
  8. Regenerate tags.c.
  9. Add it to vim/syntax/vifm.vim (don't forget to update modification date). For boolean options don't forget about highlighting no<option> and inv<option>.
  10. Remove from the TODO file.
  11. Add to the ChangeLog file.
  12. Update THANKS file if option was proposed by someone.

Adding a local option[edit]

  1. Add it to view_t structure in ui.h: <type> <name>, <name_g>;.
  2. Add it to init_view() or reset_view() function in filelist.c.
  3. Add it to write_options() function in cfg/info.c.
  4. Add it to options array in opt_handlers.c.
  5. Add it to reset_local_options(), load_view_options() and clone_local_options() functions in opt_handlers.c.
  6. Implement.
  7. Add it to vim/doc/vifm.txt (don't forget to update modification date).
  8. Add it to vifm.1 (don't forget to update modification date).
  9. Regenerate tags.c.
  10. add it to vim/syntax/vifm.vim (don't forget to update modification date). For boolean options don't forget about highlighting no<option> and inv<option>.
  11. Remove from the TODO file.
  12. Add to the ChangeLog file.
  13. Update THANKS file if option was proposed by someone.