Skip to content

Instantly share code, notes, and snippets.

@romainl
Last active July 12, 2018 05:39
Show Gist options
  • Save romainl/2dce8c4dd481247cd15dcd870e8aabc0 to your computer and use it in GitHub Desktop.
Save romainl/2dce8c4dd481247cd15dcd870e8aabc0 to your computer and use it in GitHub Desktop.

It looks like define and include can't match on the same line.

define alone

Goal: set define to a simple value and see if it works as intended.

  1. Open sample_a with:

     $ vim -Nu NONE sample_a
    
  2. Set the define option with:

     :set define=import
    
  3. List all definitions with:

     :dlist /
    
  4. Expected result:

     1:    1 import foo from 'sample_b';
    
  5. Actual result:

     1:    1 import foo from 'sample_b';
    

It works!

include alone

Goal: set include to a simple value and see if it works as intended.

  1. Open sample_a with:

     $ vim -Nu NONE sample_a
    
  2. Set the include option with:

     :set include=from
    
  3. List all includes with:

     :checkpath!
    
  4. Expected result:

     --- Included files in path ---
     sample_b
    
  5. Actual result:

     --- Included files in path ---
     sample_b
    

It works!

define and include matching on the same line

Goal: set define and include to simple values that match on the same line and see if both values are honored.

  1. Open sample_a with:

     $ vim -Nu NONE sample_a
    
  2. Set the define option with:

     :set define=import
    
  3. and the include option with:

     :set include=from
    
  4. List all definitions with:

     :dlist /
    
  5. Expected result:

     1:    1 import foo from 'sample_b';
    
  6. Actual result:

     E388: Couldn't find definition
    
  7. List all includes with:

     :checkpath!
    
  8. Expected result:

     --- Included files in path ---
     sample_b
    
  9. Actual result:

     --- Included files in path ---
     sample_b
    

It doesn't work :-(

import foo from 'sample_b'
export foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment