1. 程式人生 > >Handling of tag commands and tag stack by do_tag

Handling of tag commands and tag stack by do_tag

/*
 * Jump to tag; handling of tag commands and tag stack
 *
 * *tag != NUL: ":tag {tag}", jump to new tag, add to tag stack
 *
 * type == DT_TAG:  ":tag [tag]", jump to newer position or same tag again
 * type == DT_HELP: like DT_TAG, but don't use regexp.
 * type == DT_POP:  ":pop" or CTRL-T, jump to old position

 * type == DT_NEXT: jump to next match of same tag
 * type == DT_PREV: jump to previous match of same tag
 * type == DT_FIRST:    jump to first match of same tag
 * type == DT_LAST: jump to last match of same tag
 * type == DT_SELECT:   ":tselect [tag]", select tag from a list of all matches
 * type == DT_JUMP: ":tjump [tag]", jump to tag or select tag from a list

 * type == DT_CSCOPE:   use cscope to find the tag
 * type == DT_LTAG: use location list for displaying tag matches
 * type == DT_FREE: free cached matches
 *
 * for cscope, returns TRUE if we jumped to tag or aborted, FALSE otherwise
 */
    int
do_tag(tag, type, count, forceit, verbose)
    char_u  *tag;       /* tag (pattern) to jump to */
    int     type;
    int     count;
    int     forceit;    /* :ta with ! */

    int     verbose;    /* print "tag not found" message */

Cscope tag: phy_connect_direct
   #   line  filename / context / line
   1    419  /media/root/work/jllproject/Mangov2/branches/L170HQL2_Wisec.1/apps_proc/kernel/msm-3.18/drivers/net/phy/phy_device.c
             <<GLOBAL>>
             int phy_connect_direct(struct net_device *dev, struct phy_device *phydev,
   2    436  /media/root/work/jllproject/Mangov2/branches/L170HQL2_Wisec.1/apps_proc/kernel/msm-3.18/drivers/net/phy/phy_device.c
             <<GLOBAL>>
             EXPORT_SYMBOL(phy_connect_direct);
   3    471  /media/root/work/jllproject/Mangov2/branches/L170HQL2_Wisec.1/apps_proc/kernel/msm-3.18/drivers/net/phy/phy_device.c
             <<GLOBAL>>
             rc = phy_connect_direct(dev, phydev, handler, interface);
   4    229  /media/root/work/jllproject/Mangov2/branches/L170HQL2_Wisec.1/apps_proc/kernel/msm-3.18/drivers/of/of_mdio.c <<GLOBAL>>
             return phy_connect_direct(dev, phy, hndlr, iface) ? NULL : phy;
   5    711  /media/root/work/jllproject/Mangov2/branches/L170HQL2_Wisec.1/apps_proc/kernel/msm-3.18/include/linux/phy.h <<GLOBAL>>
             int phy_connect_direct(struct net_device *dev, struct phy_device *phydev,
   6    361  /media/root/work/jllproject/Mangov2/branches/L170HQL2_Wisec.1/apps_proc/kernel/msm-3.18/drivers/net/ethernet/8390/ax88796.c
             <<ax_mii_probe>>
             ret = phy_connect_direct(dev, phy_dev, ax_handle_link_change,
   7   1294  /media/root/work/jllproject/Mangov2/branches/L170HQL2_Wisec....s_proc/kernel/msm-3.18/drivers/net/ethernet/aeroflex/greth.c
             <<greth_mdio_probe>>
             ret = phy_connect_direct(dev, phy, &greth_link_change,
   8    720  /media/root/work/jllproject/Mangov2/branches/L170HQL2_Wisec....ernel/msm-3.18/drivers/net/ethernet/altera/altera_tse_main.c
             <<connect_local_phy>>
             ret = phy_connect_direct(dev, phydev, &altera_tse_adjust_link,
   9    602  /media/root/work/jllproject/Mangov2/branches/L170HQL2_Wisec....roc/kernel/msm-3.18/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
             <<xgbe_phy_init>>
             ret = phy_connect_direct(netdev, phydev, &xgbe_adjust_link,
  10   2205  /media/root/work/jllproject/Mangov2/branches/L170HQL2_Wisec....rnel/msm-3.18/drivers/net/ethernet/broadcom/genet/bcmgenet.c
             <<bcmgenet_open>>
             phy_connect_direct(dev, priv->phydev, bcmgenet_mii_setup,
  11    335  /media/root/work/jllproject/Mangov2/branches/L170HQL2_Wisec.1/apps_proc/kernel/msm-3.18/drivers/net/ethernet/cadence/macb.c
             <<macb_mii_probe>>
             ret = phy_connect_direct(dev, phydev, &macb_handle_link_change,
  12    683  /media/root/work/jllproject/Mangov2/branches/L170HQL2_Wisec.1/apps_proc/kernel/msm-3.18/drivers/net/ethernet/ethoc.c
             <<ethoc_mdio_probe>>
             err = phy_connect_direct(dev, phy, ethoc_mdio_poll,
  13   1900  /media/root/work/jllproject/Mangov2/branches/L170HQL2_Wisec....rnel/msm-3.18/drivers/net/ethernet/qualcomm/emac/emac_main.c
             <<emac_mac_up>>
             ret = phy_connect_direct(netdev, adpt->phydev, emac_adjust_link,
  14   1027  /media/root/work/jllproject/Mangov2/branches/L170HQL2_Wisec....ps_proc/kernel/msm-3.18/drivers/net/ethernet/smsc/smsc911x.c
             <<smsc911x_mii_probe>>
             ret = phy_connect_direct(dev, phydev, &smsc911x_phy_adjust_link,
  15    494  /media/root/work/jllproject/Mangov2/branches/L170HQL2_Wisec.1/apps_proc/kernel/msm-3.18/net/dsa/slave.c
-- More --

列表中的每一項,使用如下資料結構進行表示, 主要是為了支援滾動選單(scroll back),因此縮寫為sb

/*
 * To be able to scroll back at the "more" and "hit-enter" prompts we need to
 * store the displayed text and remember where screen lines start.
 */
typedef struct msgchunk_S msgchunk_T;
struct msgchunk_S
{
    msgchunk_T  *sb_next;
    msgchunk_T  *sb_prev;
    char    sb_eol;     /* TRUE when line ends after this text */
    int     sb_msg_col; /* column in which text starts */
    int     sb_attr;    /* text attributes */
    char_u  sb_text[1]; /* text to be displayed, actually longer */
};

這個選單項的模型如下:

NULL<---sb_prev-|============|<---sb_prev-|============|<---sb_prev-|============|
                | msgchunk_T |            | msgchunk_T |            | msgchunk_T |
                |            |            |            |            |            |
                |============|-sb_next--->|============|-sb_next--->|==============|-sb_next--->NULL

      (1).各個選單項通過 sb_prev和sb_next實現雙向連結的組織結構。

      (2).sb_eol為TRUE時表示當前代表的選單項是最後一項,這樣設計的好處是:

                通過sb_prev和sb_next可以組織很長的選單項,比如100個項,但是螢幕顯示大小並不能一次完全地顯

                示這100項,這時需要分頁顯示,而每個頁的最後一項,總要作下標記,於是需要設計sb_eol表示一螢幕

                頁的最後一項。

在已顯示的文字中移到螢幕行的開始處.

/*
 * Move to the start of screen line in already displayed text.
 */
    static msgchunk_T *
msg_sb_start(mps)
    msgchunk_T *mps;

重新顯示所有行: 

     先清除再顯示每個msgchunk_T

            /* redisplay all lines */
            screenclear();
            for (i = 0; mp != NULL && i < Rows - 1; ++i)
            {
                mp = disp_sb_line(i, mp);
                ++msg_scrolled;
            }

--------------------------  新需求 ---------------------

do_more_prompt()

---> case '/': break;  嘗試去加個/模式,表示從當前匹配表中再次羅列出所匹配的msgchunk_T.

相關推薦

Handling of tag commands and tag stack by do_tag

/* * Jump to tag; handling of tag commands and tag stack * * *tag != NUL: ":tag {tag}", jump to new tag, add to tag stack * * type == DT_T

What is the difference between Segment and tag managers? Documentation

Tag managers were built before mobile existed, when companies were mostly concerned with tracking digital ad click-throughs.Built on an older technology, t

論文閱讀:Segmentation of teeth in CT volumetric dataset by panoramic projection and variational level se

【論文資訊】 Segmentation of teeth in CT volumetric dataset by panoramic projection and variational level set Int J CARS (2008) 3:257–2

Render a controller in Twig - Unexpected “render” tag - expecting closing tag for the “block” tag defined

lin ack defined for ont per -i undle control Render a controller in Twig - Unexpected “render” tag - expecting closing tag for the “block

Making User-Managed Backups-17.3、Making User-Managed Backups of Offline Tablespaces and Datafiles

active bsp cp -rf 數據文件 nor hive %d ont data 17.3、Making User-Managed Backups of Offline Tablespaces and Datafiles 備份離線的表空間時。須要註意下面指導原則:

List of Unix commands

sequence _id args rontab filesyste wid pen ams system https://en.wikipedia.org/wiki/List_of_Unix_commands IEEE Std 1003.1-2008 utilit

Handling bundles in activities and fragments

like extra trac bundle templates have fig desc des  Bundle is a useful data holder, which maps String values to vari

Network subsystem Of Linux Performance and Tuning Guidelines

network subsystem linux網絡子系統本文出自 “庭前夜末空看雪” 博客,請務必保留此出處http://12550795.blog.51cto.com/12540795/1946086Network subsystem Of Linux Performance and Tuning Guid

About the diffrence of wait timed_wait and block in java

@override stack util except str void rgs dex interrupt import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.Reentra

Stack by pointer

這就是 one 進行 all 實例 一點 post 知識 誤操作 前言:因為棧的很多操作是基於表的,所以這篇文章裏的例程就不再大面積地寫註釋了,有不理解的地方可以翻看之前的鏈表筆記,或者直接寫在評論區。 咳咳,說到這個棧,很多人乍聽之下感覺很陌生、臥槽這是什麽玩意。

Codeforces 455D - Serega and Fun (Solved by Square Root Decomposition)

led dash exit gpo namespace unique pair div ems Problem Link: http://codeforces.com/problemset/problem/455/D Problem S

switch語句 initialization of 'XXX' is skipped by 'case' label 原因及解決辦法--塊語句的作用

style cas ack ase article xxx net 初始 break 出錯代碼段: switch (t) { case 0: int a = 0; break; default: break; }編譯時提示:“error C2361: initiali

【15】ES6 for Humans: The Latest Standard of JavaScript: ES2015 and Beyond

amazon idt keywords order line padding star ise spa 【15】ES6 for Humans共148頁:目前看到:已經全部閱讀。 亞馬遜地址:魔芋:總結:我先看的是阮一峰的在線書籍。這本書的內容很多都與之重復的。居然賣¥463

小白_Unity引擎_添加Tag和比較Tag

unity object etag cube 兩個 -- bject compare game 1 #region 2 3 //首先在引擎中添加tag標誌 4 5 //添加tag 6 gam

Tag檔案和Tag標記的用法詳解

                                      Tag檔案和Tag標記

The configuration of ftp server and client

This is the first article since April in this year. This is also the first article since I joined Microstrategy. 1 Environment Server: CentOS release 6.8

Qt Creator無法debug,報錯:The selected debugger may be inappropriate for the inferior. Examining symbols and setting breakpoints by file name and line numb

看到這個報錯我是絕望的 解決:下載windows sdk  win10 sdk 只安裝Debugging Tools for Windows   開啟 工具-選項-Kits 安裝sdk成功後我們可以看到 已經檢測到了我們安裝的cdb     開啟

for each/in/of的解釋and example

for in and turn break 情況下 數字 一個 myarray 一個數 for-of 循環:代碼示例for (var value of myArray) {console.log(value);}循環的對象需為一個數組 無法記錄索引 可以相應break、co

for each/in/of的解釋and example for each/in/of的解釋and example

    for each/in/of的解釋and example for-of 迴圈:程式碼示例for (var value of myArray) {console.log(value

Big Data Opportunities and Challenges(by周誌華)論文要點

重要 big data 環境 數據分布 範式 hal 大數據挖掘 目標 最優化 大數據環境下的機器學習 三種誤解:模型不再重要(大量數據上復雜模型依然提升顯著,大數據是的復雜模型充分利用數據且難以過擬合),相關性就足夠了(因果關系重要性無法被替代),以前的研究方向不再重